From 07f03a2a04a48616400ff0da8fcb8469fd8ff8bb Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Thu, 27 Jul 2023 15:17:31 +0200 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b75c9e7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +stages: + - deploy-test + - deploy-prod + +deploy-test: + stage: deploy-test + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + script: + - cd /opt/pyzebra + - git pull origin master --tags + - sudo systemctl restart pyzebra-test.service + +deploy-prod: + stage: deploy-prod + rules: + - if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + when: delayed + start_in: 10 minutes + script: + - source /opt/miniconda3/etc/profile.d/conda.sh + - conda activate prod + - conda update pyzebra -y + - sudo systemctl restart pyzebra.service \ No newline at end of file