2022-08-21 06:21:11 -04:00
|
|
|
workspace:
|
|
|
|
base: /git
|
|
|
|
path: pipeline
|
|
|
|
|
|
|
|
clone:
|
|
|
|
git:
|
|
|
|
image: woodpeckerci/plugin-git
|
|
|
|
|
2022-08-20 03:25:33 -04:00
|
|
|
pipeline:
|
2022-08-21 07:43:37 -04:00
|
|
|
|
2022-08-21 06:21:11 -04:00
|
|
|
check-tag:
|
2022-08-21 07:19:54 -04:00
|
|
|
image: debian:11-slim
|
2022-08-21 06:48:52 -04:00
|
|
|
pull: false
|
2022-08-20 03:25:33 -04:00
|
|
|
commands:
|
2022-08-21 07:19:54 -04:00
|
|
|
- /bin/bash check-tag.sh
|
2022-08-21 07:43:37 -04:00
|
|
|
|
2022-08-21 06:21:11 -04:00
|
|
|
clone-source:
|
|
|
|
image: docker:git
|
2022-08-21 07:41:10 -04:00
|
|
|
environment:
|
2022-08-21 07:52:37 -04:00
|
|
|
- REGISTRY=code.balsillie.net
|
|
|
|
- SOURCE_ORGANIZATION=mirrors
|
|
|
|
- REPO=matrix-service-synapse
|
2022-08-21 07:41:10 -04:00
|
|
|
commands:
|
2022-08-21 07:55:55 -04:00
|
|
|
- git clone https://$${REGISTRY}/$${SOURCE_ORGANIZATION}/$${REPO}.git /git/$${REPO}
|
|
|
|
- cd /git/$${REPO}
|
2022-08-21 06:21:11 -04:00
|
|
|
- git checkout $TAG
|
2022-08-21 07:43:37 -04:00
|
|
|
|
2022-08-21 06:21:11 -04:00
|
|
|
docker-build:
|
|
|
|
image: docker:latest
|
|
|
|
secrets:
|
|
|
|
- source: REGISTRY_PASSWORD
|
|
|
|
target: REGISTRY_PASSWORD
|
2022-08-21 07:41:10 -04:00
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
environment:
|
2022-08-21 07:52:37 -04:00
|
|
|
- REGISTRY=code.balsillie.net
|
|
|
|
- REGISTRY_USER=michael
|
|
|
|
- ORGANIZATION=containers
|
|
|
|
- REPO=matrix-service-synapse
|
|
|
|
- BUILD_ARGS="PYTHON_VERSION=3.10"
|
|
|
|
- DOCKERFILE="docker/Dockerfile"
|
|
|
|
- CONTEXT=.
|
2022-08-21 06:21:11 -04:00
|
|
|
commands:
|
|
|
|
- export DOCKER_BUILDKIT=1
|
2022-08-21 07:55:55 -04:00
|
|
|
- cd /git/$${REPO}
|
|
|
|
- echo $REGISTRY_PASSWORD | docker login $${REGISTRY} -u $${REGISTRY_USER} --password-stdin
|
2022-08-21 07:33:27 -04:00
|
|
|
- docker build
|
2022-08-21 07:55:55 -04:00
|
|
|
-t $${REGISTRY}/$${ORGANIZATION}/$${REPO}:$TAG
|
|
|
|
-t $${REGISTRY}/$${ORGANIZATION}/$${REPO}:$(date +%F)
|
|
|
|
-t $${REGISTRY}/$${ORGANIZATION}/$${REPO}:latest
|
2022-08-21 07:33:27 -04:00
|
|
|
--pull
|
2022-08-21 07:55:55 -04:00
|
|
|
--build-arg $${BUILD_ARGS}
|
|
|
|
-f $${DOCKERFILE}
|
|
|
|
$${CONTEXT}
|
|
|
|
- docker push -a $${REGISTRY}/$${ORGANIZATION}/$${REPO}
|