woodpecker-util/.woodpecker.yml

75 lines
2.0 KiB
YAML
Raw Normal View History

2022-08-21 18:54:01 -04:00
variables:
&vars
- REGISTRY=code.balsillie.net
- REGISTRY_USER=michael
- SHOUTRRR_VERSION=SHOUTRRR_VERSION=v0.6.1
- DOCKERFILE=Dockerfile
- CONTEXT=.
- MATRIX_HOST=matrix.balsillie.net
- MATRIX_PORT=443
2022-08-22 10:10:39 -04:00
- MATRIX_ROOM=!BQyqVopHitLowtucMg:balsillie.net
2022-08-21 18:54:01 -04:00
workspace:
base: /git
path: pipeline
clone:
git:
image: woodpeckerci/plugin-git
pipeline:
docker-build:
image: docker:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2022-08-21 20:12:31 -04:00
- /etc/localtime:/etc/localtime:ro
2022-08-21 18:54:01 -04:00
environment:
*vars
secrets:
- source: REGISTRY_PASSWORD
target: REGISTRY_PASSWORD
commands:
- echo $REGISTRY_PASSWORD | docker login $REGISTRY -u $REGISTRY_USER --password-stdin
- docker build
2022-08-21 19:03:44 -04:00
-t $REGISTRY/$${CI_REPO}:$${CI_COMMIT_TAG}
-t $REGISTRY/$${CI_REPO}:$(date +%F_%H-%M)
-t $REGISTRY/$${CI_REPO}:latest
2022-08-21 18:54:01 -04:00
--pull
--build-arg $${SHOUTRRR_VERSION}
-f $${DOCKERFILE}
$${CONTEXT}
2022-08-21 19:03:44 -04:00
- docker push -a $REGISTRY/$${CI_REPO}
2022-08-21 20:34:35 -04:00
when:
event: tag
tag: v*
2022-08-21 18:54:01 -04:00
2022-08-21 20:12:31 -04:00
notify-matrix-success:
image: code.balsillie.net/containers/woodpecker-util
pull: false
environment:
*vars
secrets:
- source: MATRIX_ACCESS_TOKEN
target: MATRIX_ACCESS_TOKEN
commands:
- shoutrrr send
2022-08-21 20:23:36 -04:00
--url matrix://:$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM}
2022-08-21 20:12:31 -04:00
--message "New image build of $${CI_REPO}, $${CI_COMMIT_TAG}, has been completed and pushed."
2022-08-21 20:31:42 -04:00
when:
status: [ success ]
2022-08-21 18:54:01 -04:00
2022-08-21 20:34:35 -04:00
notify-matrix-failure:
image: code.balsillie.net/containers/woodpecker-util
pull: false
environment:
*vars
secrets:
- source: MATRIX_ACCESS_TOKEN
target: MATRIX_ACCESS_TOKEN
commands:
- shoutrrr send
--url matrix://$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM}
--message "New image build of $${CI_REPO}, $${CI_COMMIT_TAG}, has failed."
when:
status: [ failure ]