Initial plugin source.

This commit is contained in:
Stephan Schnabel 2025-02-06 20:06:45 +01:00
parent a0d4b1b977
commit d2236a555c
Signed by: stephan.schnabel
GPG key ID: 115DFD33787FABF7
15 changed files with 666 additions and 0 deletions

33
.woodpecker/build.yaml Normal file
View file

@ -0,0 +1,33 @@
when:
event: [manual, push, pull_request]
branch: main
path: [.woodpecker/build.yaml, .woodpecker/push.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
matrix:
PLATFORM: [amd64, arm64]
labels:
platform: linux/${PLATFORM}
steps:
build:
image: gcr.io/kaniko-project/executor:v1.23.2-debug
commands: /kaniko/executor
--context=$CI_WORKSPACE
--destination=ci-registry.schnabel.org/kokuwaio/dockerhub-metadata:$CI_PIPELINE_NUMBER-$PLATFORM
--reproducible
--cache
--cache-copy-layers
--cache-run-layers
--cache-repo=$DOCKER_CACHE/cache/kokuwaio/dockerhub-metadata
--insecure-registry=$DOCKER_CACHE
--insecure-registry=$DOCKER_MIRROR
--registry-mirror=$DOCKER_MIRROR
--skip-default-registry-fallback
--label=org.opencontainers.image.title="Dockerhub Metadata Plugin"
--label=org.opencontainers.image.description="A Woodpecker CI plugin to write metadata to DockerHub repositories."
--label=org.opencontainers.image.url=$CI_REPO_URL
--label=org.opencontainers.image.documentation=$CI_REPO_URL
--label=org.opencontainers.image.source=$CI_REPO_CLONE_URL
--label=org.opencontainers.image.vendor=kokuwa.io
--label=org.opencontainers.image.licenses=GPL-3.0-or-later

View file

@ -0,0 +1,18 @@
when:
instance: ci.schnabel.org
repo: kokuwaio/dockerhub-metadata
event: push
branch: main
path: [.woodpecker/dockerhub.yaml, .woodpecker/build.yaml, .woodpecker/push.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh, README.md]
steps:
metadata:
image: kokuwaio/dockerhub-metadata
pull: true
settings:
repository: kokuwaio/dockerhub-metadata
description-short: A Woodpecker CI plugin to write metadata to DockerHub repositories.
categories: [developer-tools, integration-and-delivery]
username: {from_secret: DOCKERHUB_USERNAME}
password: {from_secret: DOCKERHUB_PASSWORD}

31
.woodpecker/lint.yaml Normal file
View file

@ -0,0 +1,31 @@
when:
event: [cron, manual, push, pull_request]
branch: main
path: [.woodpecker/lint.yaml, renovate.json, "**/*.yaml", "**/*.md", "**/*.sh", "**/Dockerfile"]
steps:
renovate:
image: kokuwaio/renovate-config-validator
depends_on: []
when: [path: [.woodpecker/lint.yaml, renovate.json]]
yaml:
image: kokuwaio/yamllint
depends_on: []
when: [path: [.woodpecker/lint.yaml, .yamllint.yaml, "**/*.yaml"]]
markdown:
image: kokuwaio/markdownlint
depends_on: []
when: [path: [.woodpecker/lint.yaml, .markdownlint.yaml, "**/*.md"]]
dockerfile:
image: kokuwaio/hadolint
depends_on: []
when: [path: [.woodpecker/lint.yaml, .hadolint.yaml, "**/Dockerfile"]]
shellcheck:
image: kokuwaio/shellcheck
depends_on: []
when: [path: [.woodpecker/lint.yaml, "**/*.sh"]]

36
.woodpecker/push.yaml Normal file
View file

@ -0,0 +1,36 @@
when:
instance: ci.schnabel.org
repo: kokuwaio/dockerhub-metadata
event: push
branch: main
path: [.woodpecker/build.yaml, .woodpecker/push.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
depends_on: [build]
skip_clone: true
steps:
manifest:
image: mplatform/manifest-tool:alpine-v2.1.9
commands: manifest-tool push from-args
--platforms=linux/amd64,linux/arm64
--template=ci-registry.schnabel.org/kokuwaio/dockerhub-metadata:$CI_PIPELINE_NUMBER-ARCH
--target=ci-registry.schnabel.org/kokuwaio/dockerhub-metadata:$CI_PIPELINE_NUMBER
docker.io: &push
image: quay.io/skopeo/stable:v1.17.0
depends_on: [manifest]
commands:
- echo "$AUTH" > /tmp/auth.json
- skopeo copy --all --preserve-digests --dest-precompute-digests
docker://ci-registry.schnabel.org/kokuwaio/dockerhub-metadata:$CI_PIPELINE_NUMBER
docker://$URL/kokuwaio/dockerhub-metadata:latest
environment:
URL: docker.io
AUTH: {from_secret: DOCKER_IO_AUTH}
ghcr.io:
<<: *push
environment:
URL: ghcr.io
AUTH: {from_secret: GHCR_IO_AUTH}