51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
variables:
|
|
&vars
|
|
export REGISTRY=code.balsillie.net && \
|
|
export REGISTRY_USER=michael && \
|
|
export ORGANIZATION=containers && \
|
|
export SOURCE_ORGANIZATION=mirrors && \
|
|
export REPO=matrix-service-synapse && \
|
|
export BUILD_ARGS="PYTHON_VERSION=3.10" && \
|
|
export DOCKERFILE="docker/Dockerfile" && \
|
|
export CONTEXT=.
|
|
|
|
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
|
|
commands:
|
|
- *vars
|
|
- 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
|
|
commands:
|
|
- *vars
|
|
- 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 $REGISTRY/$ORGANIZATION/$REPO:latest |