This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/.build.yml

44 lines
1.7 KiB
YAML
Raw Normal View History

2020-08-17 12:32:40 +02:00
image: archlinux
packages:
- docker
sources:
- https://git.sr.ht/~crocmagnon/blog
secrets:
2020-09-12 16:31:05 +02:00
- 388c4445-d732-440b-8ff5-fc5dfb46f04a
2020-11-11 10:45:39 +01:00
- 78118477-73c2-4805-a613-c7aab23c92a8
2020-08-17 12:32:40 +02:00
- 5c948915-48c2-4542-8fc1-a5676f4d7126
2020-08-18 08:08:07 +02:00
environment:
TESTING: true
2020-11-11 09:38:37 +01:00
DEPS_TESTS: rg.fr-par.scw.cloud/crocmagnon/blog:deps-tests
BLOG_TESTS: rg.fr-par.scw.cloud/crocmagnon/blog:tests
2020-11-11 09:38:37 +01:00
DEPS_LATEST: rg.fr-par.scw.cloud/crocmagnon/blog:deps-latest
BLOG_LATEST: rg.fr-par.scw.cloud/crocmagnon/blog:latest
2020-08-17 12:32:40 +02:00
tasks:
- setup_docker: |
./blog/docker/setup-docker
- build_and_test: |
2020-09-12 16:31:05 +02:00
docker login rg.fr-par.scw.cloud/crocmagnon -u nologin --password-stdin < .docker-secret
2020-08-21 14:32:01 +02:00
cd blog
2020-11-10 15:48:51 +01:00
docker pull $BLOG_LATEST || true
2020-11-11 09:38:37 +01:00
docker pull $BLOG_TESTS || true
docker pull $DEPS_LATEST || true
docker pull $DEPS_TESTS || true
docker build --pull --target venv --cache-from $DEPS_LATEST -t $DEPS_LATEST .
docker build --pull --target prod --cache-from $BLOG_LATEST --cache-from $DEPS_LATEST -t $BLOG_LATEST -f Dockerfile .
docker build --pull --target venv-tests --cache-from $BLOG_LATEST --cache-from $DEPS_LATEST --cache-from $DEPS_TESTS -t $DEPS_TESTS .
docker build --pull --target tests --cache-from $BLOG_LATEST --cache-from $DEPS_LATEST --cache-from $DEPS_TESTS --cache-from $BLOG_TESTS -t $BLOG_TESTS -f Dockerfile .
docker run --rm -t $BLOG_TESTS /app/docker/runtests.sh
2020-11-11 09:38:37 +01:00
docker push $BLOG_LATEST
2020-11-11 09:38:37 +01:00
docker push $DEPS_LATEST
docker push $DEPS_TESTS
docker push $BLOG_TESTS
2020-08-17 12:32:40 +02:00
- deploy: |
2020-11-11 10:45:39 +01:00
ssh blog -o StrictHostKeyChecking=no "/home/gaugendre/blog/redeploy"
2020-08-18 11:02:54 +02:00
triggers:
- action: email
condition: failure
to: Gabriel Augendre <gabriel@augendre.info>