2023-03-17 04:09:27 +00:00
variables :
docker-step : &docker-step
2022-12-28 22:27:57 +00:00
image : docker:rc-git
2022-11-12 10:55:53 +00:00
volumes :
- /var/run/docker.sock:/var/run/docker.sock
2023-03-17 04:09:27 +00:00
environment :
NAME : gitea.treehouse.systems/treehouse/mastodon
2023-04-22 07:20:04 +00:00
clone :
git :
image : woodpeckerci/plugin-git
settings :
partial : false
depth : 10
2023-03-17 04:09:27 +00:00
pipeline :
2023-04-22 07:14:40 +00:00
build-base :
2023-03-17 04:09:27 +00:00
<< : *docker-step
2022-11-12 10:50:24 +00:00
commands :
2022-12-28 22:27:57 +00:00
- docker version
2023-04-22 07:14:40 +00:00
- docker image build -f Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . --target build-base -t $NAME:build-base
# the world is not yet ready for this step
# test:
# <<: *docker-step
# commands:
# - docker run --rm -e RAILS_ENV=test -e NODE_ENV=development $NAME:build-base sh -c 'bundle config set --local without development && bundle install && rake spec'
build :
<< : *docker-step
commands :
2023-03-17 04:09:27 +00:00
- docker image build -f Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . -t $NAME:latest
- docker tag $NAME:latest $NAME:$CI_COMMIT_SHA
tag-nightly :
<< : *docker-step
commands :
- docker tag $NAME:latest $NAME:$(date -Idate -u)
# maybe we can use tags someday,,,
# tag-tag:
# image: *docker-git
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# commands:
# - docker tag $NAME:latest $NAME:$CI_COMMIT_TAG
# 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 :
2022-11-12 11:18:48 +00:00
- echo $REGISTRY_SECRET | docker login -u ariadne --password-stdin gitea.treehouse.systems
2023-03-17 04:09:27 +00:00
- docker image push --all-tags $NAME
2022-11-12 10:50:24 +00:00
when :
event : [ push, tag]
2022-11-13 03:23:58 +00:00
branch : main
2022-11-12 14:08:48 +00:00
secrets : [ REGISTRY_SECRET]