Compare commits
No commits in common. "main" and "v2.0.23-1" have entirely different histories.
35
.drone.yml
35
.drone.yml
@ -27,16 +27,33 @@ platform:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: binary
|
||||||
|
image: dart:stable
|
||||||
|
commands:
|
||||||
|
- apt-get -qq update && apt-get install -yqq --no-install-recommends make
|
||||||
|
- make build
|
||||||
|
environment:
|
||||||
|
BUILD_VERSION: ${DRONE_TAG%-*}
|
||||||
|
|
||||||
|
- name: verify
|
||||||
|
image: dart:stable
|
||||||
|
commands:
|
||||||
|
- src/build/linkcheck/linkcheck --help
|
||||||
|
- src/build/linkcheck/linkcheck --version
|
||||||
|
depends_on:
|
||||||
|
- binary
|
||||||
|
|
||||||
- name: dryrun
|
- name: dryrun
|
||||||
image: thegeeklab/drone-docker-buildx:23
|
image: thegeeklab/drone-docker-buildx:20
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
dry_run: true
|
dry_run: true
|
||||||
provenance: false
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
repo: thegeeklab/${DRONE_REPO_NAME}
|
||||||
when:
|
when:
|
||||||
ref:
|
ref:
|
||||||
- refs/pull/**
|
- refs/pull/**
|
||||||
|
depends_on:
|
||||||
|
- verify
|
||||||
|
|
||||||
- name: tags
|
- name: tags
|
||||||
image: thegeeklab/docker-autotag
|
image: thegeeklab/docker-autotag
|
||||||
@ -69,12 +86,11 @@ steps:
|
|||||||
- changelog-generate
|
- changelog-generate
|
||||||
|
|
||||||
- name: publish-dockerhub
|
- name: publish-dockerhub
|
||||||
image: thegeeklab/drone-docker-buildx:23
|
image: thegeeklab/drone-docker-buildx:20
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
provenance: false
|
|
||||||
repo: thegeeklab/${DRONE_REPO_NAME}
|
repo: thegeeklab/${DRONE_REPO_NAME}
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
@ -86,12 +102,11 @@ steps:
|
|||||||
- changelog-format
|
- changelog-format
|
||||||
|
|
||||||
- name: publish-quay
|
- name: publish-quay
|
||||||
image: thegeeklab/drone-docker-buildx:23
|
image: thegeeklab/drone-docker-buildx:20
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
password:
|
password:
|
||||||
from_secret: quay_password
|
from_secret: quay_password
|
||||||
provenance: false
|
|
||||||
registry: quay.io
|
registry: quay.io
|
||||||
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
|
||||||
username:
|
username:
|
||||||
@ -138,6 +153,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: pushrm-dockerhub
|
- name: pushrm-dockerhub
|
||||||
|
pull: always
|
||||||
image: chko/docker-pushrm:1
|
image: chko/docker-pushrm:1
|
||||||
environment:
|
environment:
|
||||||
DOCKER_PASS:
|
DOCKER_PASS:
|
||||||
@ -145,13 +161,14 @@ steps:
|
|||||||
DOCKER_USER:
|
DOCKER_USER:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
PUSHRM_FILE: README.md
|
PUSHRM_FILE: README.md
|
||||||
PUSHRM_SHORT: Custom image for muffet
|
PUSHRM_SHORT: Custom image for linkcheck
|
||||||
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
|
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
|
||||||
when:
|
when:
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
|
|
||||||
- name: pushrm-quay
|
- name: pushrm-quay
|
||||||
|
pull: always
|
||||||
image: chko/docker-pushrm:1
|
image: chko/docker-pushrm:1
|
||||||
environment:
|
environment:
|
||||||
APIKEY__QUAY_IO:
|
APIKEY__QUAY_IO:
|
||||||
@ -171,7 +188,7 @@ steps:
|
|||||||
from_secret: matrix_password
|
from_secret: matrix_password
|
||||||
roomid:
|
roomid:
|
||||||
from_secret: matrix_roomid
|
from_secret: matrix_roomid
|
||||||
template: "Status: **{{ .Build.Status }}**<br/> Build: [{{ .Repo.Owner }}/{{ .Repo.Name }}]({{ .Build.Link }}){{ if .Build.Branch }} ({{ .Build.Branch }}){{ end }} by {{ .Commit.Author }}<br/> Message: {{ .Commit.Message.Title }}"
|
template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}"
|
||||||
username:
|
username:
|
||||||
from_secret: matrix_username
|
from_secret: matrix_username
|
||||||
when:
|
when:
|
||||||
@ -192,6 +209,6 @@ depends_on:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 78e01e7829a4953f6068e8c71f068cc449d5a41d6ea26adc7ad456d19b0ed40f
|
hmac: 8746fe501b443c4f93f766414ef030b10c28cdc0cc19ca5984601c4bb5f98bf6
|
||||||
|
|
||||||
...
|
...
|
||||||
|
23
Dockerfile
23
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM debian:bullseye-slim@sha256:9bec46ecd98ce4bf8305840b021dda9b3e1f8494a0768c407e2b233180fa1466
|
FROM debian:bullseye-slim@sha256:fbaacd55d14bd0ae0c0441c2347217da77ad83c517054623357d1f9d07f79f5e
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
@ -12,36 +12,29 @@ ARG WAIT_FOR_VERSION
|
|||||||
ARG CONTAINER_LIBRARY
|
ARG CONTAINER_LIBRARY
|
||||||
|
|
||||||
# renovate: datasource=github-releases depName=caddyserver/caddy
|
# renovate: datasource=github-releases depName=caddyserver/caddy
|
||||||
ENV CADDY_VERSION="${CADDY_VERSION:-v2.7.4}"
|
ENV CADDY_VERSION="${CADDY_VERSION:-v2.5.1}"
|
||||||
# renovate: datasource=github-releases depName=thegeeklab/wait-for
|
# renovate: datasource=github-releases depName=thegeeklab/wait-for
|
||||||
ENV WAIT_FOR_VERSION="${WAIT_FOR_VERSION:-v0.4.2}"
|
ENV WAIT_FOR_VERSION="${WAIT_FOR_VERSION:-v0.2.0}"
|
||||||
# renovate: datasource=github-releases depName=thegeeklab/retry
|
|
||||||
ENV RETRY_VERSION="${RETRY_VERSION:-v0.4.0}"
|
|
||||||
# renovate: datasource=github-releases depName=raviqqe/muffet
|
|
||||||
ENV MUFFET_VERSION="${MUFFET_VERSION:-v2.9.2}"
|
|
||||||
# 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}"
|
||||||
|
|
||||||
ENV LINK_VALIDATOR_BASE_DIR=/drone/src \
|
ENV LINK_VALIDATOR_BASE_DIR=/drone/src \
|
||||||
LINK_VALIDATOR_SERVER_PORT=8000 \
|
LINK_VALIDATOR_SERVER_PORT=8000
|
||||||
LINK_VALIDATOR_RETRIES=0
|
|
||||||
|
|
||||||
COPY overlay/ /
|
COPY overlay/ /
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl bash ncat media-types && \
|
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 -SsL "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 "https://github.com/raviqqe/muffet/releases/download/${MUFFET_VERSION}/muffet_linux_amd64.tar.gz" | tar xz -C /usr/local/bin muffet && \
|
curl -SsL -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/muffet && \
|
|
||||||
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/
|
||||||
|
|
||||||
|
ADD src/build/linkcheck/linkcheck /usr/local/bin/linkcheck
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
CMD []
|
CMD []
|
||||||
ENTRYPOINT ["/bin/link-validator"]
|
ENTRYPOINT ["/bin/link-validator"]
|
||||||
|
29
Makefile
Normal file
29
Makefile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# renovate: datasource=github-tags depName=filiph/linkcheck
|
||||||
|
export BUILD_VERSION ?= 2.0.23
|
||||||
|
export PATH := $(PATH):$(HOME)/.pub-cache/bin
|
||||||
|
|
||||||
|
SRC := src
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: build
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: build-src build-bin
|
||||||
|
|
||||||
|
.PHONY: build-src
|
||||||
|
build-src:
|
||||||
|
mkdir -p $(SRC); \
|
||||||
|
curl -sSL "https://github.com/filiph/linkcheck/archive/$${BUILD_VERSION##v}.tar.gz" | tar xz -C $(SRC) --strip-components=1
|
||||||
|
|
||||||
|
.PHONY: build-bin
|
||||||
|
build-bin:
|
||||||
|
dart --disable-analytics --version; \
|
||||||
|
cd $(SRC); \
|
||||||
|
dart pub get; \
|
||||||
|
dart pub global activate grinder; \
|
||||||
|
grind pkg-standalone-linux-x64; \
|
||||||
|
tar xzf build/linkcheck-*-linux-x64.tar.gz -C ./build
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -rf $(SRC)
|
@ -1,6 +1,6 @@
|
|||||||
# link-validator
|
# link-validator
|
||||||
|
|
||||||
Custom image for muffet
|
Custom image for linkcheck
|
||||||
|
|
||||||
[![Build Status](https://img.shields.io/drone/build/docker/link-validator?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/docker/link-validator)
|
[![Build Status](https://img.shields.io/drone/build/docker/link-validator?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/docker/link-validator)
|
||||||
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/link-validator)
|
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/link-validator)
|
||||||
@ -8,15 +8,15 @@ Custom image for muffet
|
|||||||
[![Source: Gitea](https://img.shields.io/badge/source-gitea-blue.svg?logo=gitea&logoColor=white)](https://gitea.rknet.org/docker/link-validator)
|
[![Source: Gitea](https://img.shields.io/badge/source-gitea-blue.svg?logo=gitea&logoColor=white)](https://gitea.rknet.org/docker/link-validator)
|
||||||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/docker/link-validator/src/branch/main/LICENSE)
|
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/docker/link-validator/src/branch/main/LICENSE)
|
||||||
|
|
||||||
Custom wrapper Docker image for [muffet](https://github.com/raviqqe/muffet) optimized for CI.
|
Custom wrapper Docker image for [linkcheck](https://github.com/filiph/linkcheck/) optimized for CI.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```Shell
|
```Shell
|
||||||
docker run -v $(pwd)/public:/drone/src link-validator
|
docker run -v $(pwd)/public:/drone/src link-validator
|
||||||
|
|
||||||
# Pass arguments to muffet
|
# or pass arguments to linkcheck
|
||||||
# ... but DO NOT set the server url! This is done automatically.
|
# ... but DO NOT set the server url! This will be done automatically. See environment variables.
|
||||||
docker run -v $(pwd)/public:/drone/src link-validator -e
|
docker run -v $(pwd)/public:/drone/src link-validator -e
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -25,7 +25,6 @@ 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
|
||||||
|
@ -12,5 +12,5 @@ caddy file-server --root "$LINK_VALIDATOR_BASE_DIR" --listen "$URL" &
|
|||||||
log_info "Wait for web server on '$URL'"
|
log_info "Wait for web server on '$URL'"
|
||||||
/usr/local/bin/wait-for "$URL"
|
/usr/local/bin/wait-for "$URL"
|
||||||
|
|
||||||
log_info "Start link validation"
|
log_info "Start linkcheck"
|
||||||
exec retry -t "$LINK_VALIDATOR_RETRIES" -m 5 -- "/usr/local/bin/muffet $* http://$URL"
|
exec /usr/local/bin/linkcheck "$@" "$URL"
|
||||||
|
Reference in New Issue
Block a user