Compare commits

..

No commits in common. "main" and "v0.7.8-7" have entirely different histories.

10 changed files with 176 additions and 265 deletions

View File

@ -1,23 +0,0 @@
# Changelog
{{ range .Versions -}}
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pulls/${2}") | trim }}
{{ end }}
{{- end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

View File

@ -1,25 +0,0 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://gitea.rknet.org/docker/link-validator
options:
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
chore: Others
test: Testing
ci: CI Pipeline
docs: Documentation
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE

View File

@ -7,16 +7,16 @@ platform:
arch: amd64
steps:
- name: markdownlint
image: thegeeklab/markdownlint-cli
commands:
- markdownlint 'README.md'
- name: markdownlint
image: thegeeklab/markdownlint-cli
commands:
- markdownlint 'README.md'
trigger:
ref:
- refs/heads/main
- refs/pull/**
- refs/tags/**
- refs/heads/main
- refs/pull/**
- refs/tags/**
---
kind: pipeline
@ -27,106 +27,97 @@ platform:
arch: amd64
steps:
- name: dryrun
image: thegeeklab/drone-docker-buildx:23
settings:
dockerfile: Dockerfile
dry_run: true
provenance: false
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
- name: dryrun
image: thegeeklab/drone-docker-buildx:20
settings:
build_args:
- BUILD_VERSION=${DRONE_TAG%-*}
dockerfile: Dockerfile
dry_run: true
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/pull/**
- name: tags
image: thegeeklab/docker-autotag
environment:
DOCKER_AUTOTAG_FORCE_LATEST: True
DOCKER_AUTOTAG_IGNORE_PRERELEASE: True
DOCKER_AUTOTAG_OUTPUT_FILE: .tags
DOCKER_AUTOTAG_VERSION: ${DRONE_TAG}
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: tags
image: thegeeklab/docker-autotag
environment:
DOCKER_AUTOTAG_FORCE_LATEST: True
DOCKER_AUTOTAG_IGNORE_PRERELEASE: True
DOCKER_AUTOTAG_OUTPUT_FILE: .tags
DOCKER_AUTOTAG_VERSION: ${DRONE_TAG}
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: changelog-generate
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
depends_on:
- tags
- name: publish-dockerhub
image: thegeeklab/drone-docker-buildx:20
settings:
build_args:
- BUILD_VERSION=${DRONE_TAG%-*}
dockerfile: Dockerfile
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- tags
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
depends_on:
- changelog-generate
- name: publish-quay
image: thegeeklab/drone-docker-buildx:20
settings:
build_args:
- BUILD_VERSION=${DRONE_TAG%-*}
dockerfile: Dockerfile
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- tags
- name: publish-dockerhub
image: thegeeklab/drone-docker-buildx:23
settings:
dockerfile: Dockerfile
password:
from_secret: docker_password
provenance: false
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- changelog-format
- name: publish-quay
image: thegeeklab/drone-docker-buildx:23
settings:
dockerfile: Dockerfile
password:
from_secret: quay_password
provenance: false
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- changelog-format
- name: publish-gitea
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.rknet.org
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
depends_on:
- publish-dockerhub
- publish-quay
- name: publish-gitea
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.rknet.org
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
depends_on:
- publish-dockerhub
- publish-quay
trigger:
ref:
- refs/heads/main
- refs/pull/**
- refs/tags/**
- refs/heads/main
- refs/pull/**
- refs/tags/**
depends_on:
- test
- test
---
kind: pipeline
@ -137,61 +128,63 @@ platform:
arch: amd64
steps:
- name: pushrm-dockerhub
image: chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_SHORT: Custom image for muffet
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-dockerhub
pull: always
image: chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_SHORT: Custom image for broken-link-checker
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
image: chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
pull: always
image: chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: matrix
image: thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
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 }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- name: matrix
image: plugins/matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- success
- failure
depends_on:
- build-container
- build-container
---
kind: signature
hmac: 78e01e7829a4953f6068e8c71f068cc449d5a41d6ea26adc7ad456d19b0ed40f
hmac: e99ea2a36081a89c672526b280174bed22ffd900c25ee03c5aacca0c4c9714d4
...

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
CHANGELOG.md
/src

View File

@ -1,3 +1 @@
.drone.yml
*.tpl.md
LICENSE

8
CHANGELOG.md Normal file
View File

@ -0,0 +1,8 @@
# Changelog
## v0.7.8-7 (2021-01-29)
### Others
- **deps:** update node:lts-alpine3.12 docker digest to 92c8a9d
- **deps:** update dependency caddyserver/caddy to v2.3.0

View File

@ -1,4 +1,4 @@
FROM debian:bullseye-slim@sha256:9bec46ecd98ce4bf8305840b021dda9b3e1f8494a0768c407e2b233180fa1466
FROM node:lts-alpine3.12@sha256:92c8a9d70dcbc8bb628c346ae1c39ea521103d998496a49fb072332c63228a65
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
@ -7,40 +7,35 @@ LABEL org.opencontainers.image.url="https://gitea.rknet.org/docker/link-validato
LABEL org.opencontainers.image.source="https://gitea.rknet.org/docker/link-validator"
LABEL org.opencontainers.image.documentation="https://gitea.rknet.org/docker/link-validator"
ARG CADDY_VERSION
ARG WAIT_FOR_VERSION
ARG CONTAINER_LIBRARY
ARG BUILD_VERSION
# renovate: datasource=npm depName=broken-link-checker
ENV BLC_VERSION="${BUILD_VERSION:-0.7.8}"
# renovate: datasource=github-releases depName=caddyserver/caddy
ENV CADDY_VERSION="${CADDY_VERSION:-v2.7.4}"
# renovate: datasource=github-releases depName=thegeeklab/wait-for
ENV WAIT_FOR_VERSION="${WAIT_FOR_VERSION:-v0.4.2}"
# 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
ENV CONTAINER_LIBRARY="${CONTAINER_LIBRARY:-v0.1.3}"
ENV CADDY_VERSION="${CADDY_VERSION:-v2.3.0}"
ENV LINK_VALIDATOR_BASE_DIR=/drone/src \
LINK_VALIDATOR_SERVER_PORT=8000 \
LINK_VALIDATOR_RETRIES=0
LINK_VALIDATOR_SERVER_PORT=80 \
FORCE_COLOR=true \
NPM_CONFIG_LOGLEVEL=error
COPY overlay/ /
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 / && \
RUN echo "Installing requirements ..." && \
apk --update add --virtual .build-deps curl && \
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 -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/muffet && \
chmod 755 /usr/local/bin/wait-for && \
chmod 755 /usr/local/bin/retry && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /root/.cache/
BLC_VERSION="${BLC_VERSION##v}" && \
BLC_MAJOR="${BLC_VERSION%%.*}" && \
if [ -z "${BLC_MAJOR//[0-9]}" ] && [ -n "$BLC_MAJOR" ]; then \
echo "Installing link-checker version '$BLC_VERSION' ..." && \
npm install -g broken-link-checker@"$BLC_VERSION"; \
else \
echo "Installing latest link-checker ..." && \
npm install -g broken-link-checker; \
fi && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
USER root
CMD []

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 Robert Kaussow <mail@thegeeklab.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,6 +1,6 @@
# link-validator
Custom image for muffet
Custom image for broken-link-checker
[![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)
@ -8,16 +8,16 @@ 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)
[![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 [broken-link-checker](https://github.com/stevenvachon/broken-link-checker) optimized for CI.
## Usage
```Shell
docker run -v $(pwd)/public:/drone/src link-validator
# Pass arguments to muffet
# ... but DO NOT set the server url! This is done automatically.
docker run -v $(pwd)/public:/drone/src link-validator -e
# or pass arguments to broken-link-checker
# ... but DO NOT set the server url! This will be done automatically. See environment variables.
docker run -v $(pwd)/public:/drone/src link-validator -ro
```
## Environment variables
@ -25,7 +25,6 @@ docker run -v $(pwd)/public:/drone/src link-validator -e
```Shell
LINK_VALIDATOR_BASE_DIR=/drone/src
LINK_VALIDATOR_SERVER_PORT=8000
LINK_VALIDATOR_RETRIES=0
```
## Build

View File

@ -1,16 +1,5 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
set -eo pipefail
# shellcheck disable=SC1091
. /usr/local/lib/log.sh
URL="127.0.0.1:$LINK_VALIDATOR_SERVER_PORT"
caddy file-server --root "$LINK_VALIDATOR_BASE_DIR" --listen "$URL" &
log_info "Wait for web server on '$URL'"
/usr/local/bin/wait-for "$URL"
log_info "Start link validation"
exec retry -t "$LINK_VALIDATOR_RETRIES" -m 5 -- "/usr/local/bin/muffet $* http://$URL"
caddy file-server --root "$LINK_VALIDATOR_BASE_DIR" --listen "127.0.0.1:$LINK_VALIDATOR_SERVER_PORT" &> /dev/null &
exec /usr/local/bin/broken-link-checker "$@" http://localhost:"$LINK_VALIDATOR_SERVER_PORT"