From 69e08a70be3f9921b783d48f636a1366cf885741 Mon Sep 17 00:00:00 2001 From: s3lph Date: Wed, 11 Jul 2018 17:17:00 +0200 Subject: [PATCH] Added a staging deployment CI job. --- .gitlab-ci.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2da70d5..566855e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,8 @@ image: s3lph/matemat-ci:20180711-01 stages: - test -- codestyle -- deploy +- build +- staging test: stage: test @@ -14,15 +14,24 @@ test: - sudo -u matemat python3-coverage report -m --include 'matemat/*' --omit '*/test_*.py' codestyle: - stage: codestyle + stage: test script: - pip3 install -r requirements.txt - sudo -u matemat pycodestyle matemat # - sudo -u matemat mypy --ignore-missing-imports --strict -p matemat -docker_build_push: - stage: deploy +build: + stage: build script: - docker build -t "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" . - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com - docker push "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" + +staging: + stage: staging + script: + - ssh add - <<<"$STAGING_SSH_PRIVATE_KEY" + - echo "$(git rev-parse HEAD)" | ssh -p 20022 matemat@kernelpanic.lol + environment: + - name: staging + - url: https://matemat.kernelpanic.lol/