diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0ef075e..62cd9f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,20 +15,29 @@ build-and-publish: deploy-test: stage: deploy + environment: testing rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH script: - cd /opt/pyzebra - git pull origin master --tags + - source /opt/miniconda3/etc/profile.d/conda.sh + - conda activate test + - conda build ./conda-recipe + - conda install --use-local --only-deps pyzebra -y + - conda build purge-all - sudo systemctl restart pyzebra-test.service deploy-prod: stage: deploy + environment: production needs: ["build-and-publish"] rules: - if: $CI_COMMIT_TAG + when: delayed + start_in: 5 seconds script: - source /opt/miniconda3/etc/profile.d/conda.sh - conda activate prod - conda update pyzebra -y - - sudo systemctl restart pyzebra.service + - sudo systemctl restart pyzebra-prod.service