feat: add retry option
This commit is contained in:
parent
c02502e17c
commit
de2c79696a
@ -15,6 +15,8 @@ ARG CONTAINER_LIBRARY
|
|||||||
ENV CADDY_VERSION="${CADDY_VERSION:-v2.6.2}"
|
ENV CADDY_VERSION="${CADDY_VERSION:-v2.6.2}"
|
||||||
# renovate: datasource=github-releases depName=thegeeklab/wait-for
|
# renovate: datasource=github-releases depName=thegeeklab/wait-for
|
||||||
ENV WAIT_FOR_VERSION="${WAIT_FOR_VERSION:-v0.2.0}"
|
ENV WAIT_FOR_VERSION="${WAIT_FOR_VERSION:-v0.2.0}"
|
||||||
|
# renovate: datasource=github-releases depName=thegeeklab/retry
|
||||||
|
ENV RETRY_VERSION="${RETRY_VERSION:-v0.3.0}"
|
||||||
# renovate: datasource=git-tags depName=https://gitea.rknet.org/docker/container-library
|
# renovate: datasource=git-tags depName=https://gitea.rknet.org/docker/container-library
|
||||||
ENV CONTAINER_LIBRARY="${CONTAINER_LIBRARY:-v0.1.3}"
|
ENV CONTAINER_LIBRARY="${CONTAINER_LIBRARY:-v0.1.3}"
|
||||||
|
|
||||||
@ -27,8 +29,10 @@ RUN apt-get update && apt-get install -y curl bash ncat media-types && \
|
|||||||
curl -SsfL "https://gitea.rknet.org/docker/container-library/releases/download/${CONTAINER_LIBRARY}/container-library.tar.gz" | tar xz -C / && \
|
curl -SsfL "https://gitea.rknet.org/docker/container-library/releases/download/${CONTAINER_LIBRARY}/container-library.tar.gz" | tar xz -C / && \
|
||||||
curl -sSL "https://github.com/caddyserver/caddy/releases/download/${CADDY_VERSION}/caddy_${CADDY_VERSION##v}_linux_amd64.tar.gz" | tar xz -C /usr/local/bin caddy && \
|
curl -sSL "https://github.com/caddyserver/caddy/releases/download/${CADDY_VERSION}/caddy_${CADDY_VERSION##v}_linux_amd64.tar.gz" | tar xz -C /usr/local/bin caddy && \
|
||||||
curl -SsfL -o /usr/local/bin/wait-for "https://github.com/thegeeklab/wait-for/releases/download/${WAIT_FOR_VERSION}/wait-for" && \
|
curl -SsfL -o /usr/local/bin/wait-for "https://github.com/thegeeklab/wait-for/releases/download/${WAIT_FOR_VERSION}/wait-for" && \
|
||||||
|
curl -SsfL -o /usr/local/bin/retry "https://github.com/thegeeklab/retry/releases/download/${RETRY_VERSION}/retry" && \
|
||||||
chmod 755 /usr/local/bin/caddy && \
|
chmod 755 /usr/local/bin/caddy && \
|
||||||
chmod 755 /usr/local/bin/wait-for && \
|
chmod 755 /usr/local/bin/wait-for && \
|
||||||
|
chmod 755 /usr/local/bin/retry && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
rm -rf /tmp/* && \
|
rm -rf /tmp/* && \
|
||||||
rm -rf /root/.cache/
|
rm -rf /root/.cache/
|
||||||
|
@ -25,6 +25,7 @@ docker run -v $(pwd)/public:/drone/src link-validator -e
|
|||||||
```Shell
|
```Shell
|
||||||
LINK_VALIDATOR_BASE_DIR=/drone/src
|
LINK_VALIDATOR_BASE_DIR=/drone/src
|
||||||
LINK_VALIDATOR_SERVER_PORT=8000
|
LINK_VALIDATOR_SERVER_PORT=8000
|
||||||
|
LINK_VALIDATOR_RETRIES=0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
@ -13,4 +13,4 @@ log_info "Wait for web server on '$URL'"
|
|||||||
/usr/local/bin/wait-for "$URL"
|
/usr/local/bin/wait-for "$URL"
|
||||||
|
|
||||||
log_info "Start linkcheck"
|
log_info "Start linkcheck"
|
||||||
exec /usr/local/bin/linkcheck "$@" "$URL"
|
exec retry -t "${LINK_VALIDATOR_RETRIES:-0}" -- /usr/local/bin/linkcheck "$@" "$URL"
|
||||||
|
Reference in New Issue
Block a user