matrix-service-synapse/.woodpecker/main.yml
Michael Balsillie d88041bfbf
All checks were successful
ci/woodpecker/push/main Pipeline was successful
build arg didn't take
2022-08-22 00:17:28 +12:00

55 lines
1.4 KiB
YAML

workspace:
base: /git
path: pipeline
clone:
git:
image: woodpeckerci/plugin-git
pipeline:
check-tag:
image: debian:11-slim
pull: false
commands:
- /bin/bash check-tag.sh
clone-source:
image: docker:git
environment:
- REGISTRY=code.balsillie.net
- SOURCE_ORGANIZATION=mirrors
- REPO=matrix-service-synapse
commands:
- git clone https://$REGISTRY/$SOURCE_ORGANIZATION/$REPO.git /git/$REPO
- cd /git/$REPO
- git checkout $TAG
docker-build:
image: docker:latest
secrets:
- source: REGISTRY_PASSWORD
target: REGISTRY_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- REGISTRY=code.balsillie.net
- REGISTRY_USER=michael
- ORGANIZATION=containers
- REPO=matrix-service-synapse
- BUILD_ARGS=PYTHON_VERSION=3.10
- DOCKERFILE=docker/Dockerfile
- CONTEXT=.
commands:
- export DOCKER_BUILDKIT=1
- cd /git/$${REPO}
- echo $REGISTRY_PASSWORD | docker login $REGISTRY -u $REGISTRY_USER --password-stdin
- docker build
-t $REGISTRY/$ORGANIZATION/$REPO:$TAG
-t $REGISTRY/$ORGANIZATION/$REPO:$(date +%F)
-t $REGISTRY/$ORGANIZATION/$REPO:latest
--pull
--build-arg $${BUILD_ARGS}
-f $${DOCKERFILE}
$${CONTEXT}
- docker push -a $REGISTRY/$ORGANIZATION/$REPO