mastodon/.woodpecker.yml

59 lines
2.0 KiB
YAML
Raw Normal View History

2023-03-17 04:09:27 +00:00
variables:
2023-04-24 09:22:10 +00:00
environment: &docker-environment
2024-02-01 18:09:23 +00:00
SERVER_IMAGE: gitea.treehouse.systems/treehouse/mastodon
STREAMING_IMAGE: gitea.treehouse.systems/treehouse/mastodon-streaming
2023-04-24 09:22:10 +00:00
DATE_COMMAND: export COMMIT_DATE=$(date -u -Idate -d @$(git show -s --format=%ct))
2023-03-17 04:09:27 +00:00
docker-step: &docker-step
2022-12-28 22:27:57 +00:00
image: docker:rc-git
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2023-03-17 04:09:27 +00:00
environment:
2023-04-24 09:22:10 +00:00
<<: *docker-environment
2023-04-22 07:20:04 +00:00
clone:
git:
image: woodpeckerci/plugin-git
settings:
partial: false
depth: 10
2023-04-22 07:20:04 +00:00
2023-03-17 04:09:27 +00:00
pipeline:
2023-07-07 05:46:49 +00:00
output:
<<: *docker-step
commands:
2023-04-24 07:05:57 +00:00
- eval $DATE_COMMAND
- export TAG=$${COMMIT_DATE}.$CI_COMMIT_SHA && echo $${TAG}
2024-02-01 18:09:23 +00:00
- docker image build -f Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . -t $SERVER_IMAGE:$${TAG}
- docker image build -f streaming/Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . -t $STREAMING_IMAGE:$${TAG}
- docker tag $SERVER_IMAGE:$${TAG} $SERVER_IMAGE:latest
2024-02-11 04:22:44 +00:00
- docker tag $STREAMING_IMAGE:$${TAG} $STREAMING_IMAGE:latest
2024-02-01 18:09:23 +00:00
- echo -n > tags.txt
- echo $${TAG} | tee -a tags.txt
- echo latest | tee -a tags.txt
2023-03-17 04:09:27 +00:00
# maybe we can use tags someday,,,
# tag-tag:
# image: *docker-git
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# commands:
2024-02-01 18:09:23 +00:00
# - docker tag $SERVER_IMAGE:latest $SERVER_IMAGE:$CI_COMMIT_TAG
2023-03-17 04:09:27 +00:00
# when:
# event: tag
2022-11-12 10:50:24 +00:00
push:
2023-03-17 04:09:27 +00:00
<<: *docker-step
2022-11-12 10:50:24 +00:00
commands:
2023-04-24 07:05:57 +00:00
- echo $REGISTRY_SECRET | docker login -u $REGISTRY_USER --password-stdin gitea.treehouse.systems
2024-02-01 18:09:23 +00:00
- cat tags.txt | xargs -n 1 -I% echo docker image push $SERVER_IMAGE:%
- cat tags.txt | xargs -n 1 -I% docker image push $SERVER_IMAGE:%
- cat tags.txt | xargs -n 1 -I% echo docker image push $STREAMING_IMAGE:%
- cat tags.txt | xargs -n 1 -I% docker image push $STREAMING_IMAGE:%
2022-11-12 10:50:24 +00:00
when:
event: [push, tag]
branch: main
2022-11-12 14:08:48 +00:00
secrets: [REGISTRY_SECRET]
2023-04-24 07:05:57 +00:00
environment:
2023-04-24 09:22:10 +00:00
<<: *docker-environment
2023-04-24 07:05:57 +00:00
REGISTRY_USER: ariadne