forgejo/.woodpecker/docker-release-version.yml

73 lines
2.3 KiB
YAML

platform: linux/amd64
when:
event: tag
depends_on:
- testing-amd64
variables:
- &git_image 'docker:git'
- &dind_image 'docker:20.10-dind'
- &buildx_image 'woodpeckerci/plugin-docker-buildx:2.0.0'
- &integration_image 'codeberg.org/forgejo-integration/forgejo'
pipeline:
fetch-tags:
image: *git_image
pull: true
commands:
- git config --add safe.directory '*'
- git fetch --tags --force
publish-integration:
image: *buildx_image
pull: true
settings:
platforms: linux/amd64,linux/arm64
registry:
from_secret: domain
tag: ${CI_COMMIT_TAG##v}
repo: *integration_image
build_args:
- GOPROXY=https://proxy.golang.org,direct
password:
from_secret: releaseteamtoken
username:
from_secret: releaseteamuser
publish:
image: *dind_image
environment:
INTEGRATION_IMAGE: *integration_image
commands:
- apk --update --no-cache add coredns
- ( echo ".:53 {" ; echo " forward . /etc/resolv.conf"; echo "}" ) > /etc/coredns/Corefile
- coredns -conf /etc/coredns/Corefile &
- /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock --dns 172.17.0.3 &
- for i in $$(seq 60) ; do DOCKER_HOST=unix:///var/run/docker.sock docker version && break ; sleep 1 ; done
- tag=${CI_COMMIT_TAG##v}
- docker login -p "$RELEASETEAMTOKEN" -u "$RELEASETEAMUSER" $DOMAIN
- tagged_image=$${INTEGRATION_IMAGE}':'$$tag
- manifests=""
- for arch in arm64 amd64 ; do
- arch_image=${CI_REPO_LINK##https://}':'$$tag-$$arch
- docker pull --platform linux/$$arch $$tagged_image
- docker run --platform linux/$$arch --rm $$tagged_image gitea --version | grep 'built with'
- docker tag $$tagged_image $$arch_image
- docker push $$arch_image
- manifests="$$manifests $$arch_image"
- docker image prune --all --force
- done
- published=${CI_REPO_LINK##https://}':'$$tag
- docker manifest create $$published $$manifests
- docker manifest push $$published
- short_tag=$${tag%.*-*}
- short_published=${CI_REPO_LINK##https://}':'$$short_tag
- docker manifest create $$short_published $$manifests
- docker manifest push $$short_published
secrets:
- releaseteamtoken
- releaseteamuser
- domain