From 2dcd23a28c6b43b1e13ee3aba4470acf0b29fda0 Mon Sep 17 00:00:00 2001 From: Daan Sprenkels Date: Fri, 29 Mar 2019 15:01:26 +0100 Subject: [PATCH] ci: Add deploy stage --- .gitlab-ci.yml | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25975d3..b882f61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,41 @@ before_script: - - apt-get -qq update - - apt-get -qq install -y python3 python3-venv python3-pip - - python3 -m venv venv - - source venv/bin/activate - - pip install -r requirements.txt pylint + - apt-get -qq update + - apt-get -qq install -y python3 python3-venv python3-pip + - python3 -m venv venv + - source venv/bin/activate + - pip install -r requirements.txt pylint -pylint: - script: - - pylint marietje/marietje marietje/metrics marietje/playerapi marietje/queues marietje/songs marietje/stats +stages: + - lint + - deploy + +lint: + script: + - pylint marietje/marietje marietje/metrics marietje/playerapi marietje/queues marietje/songs marietje/stats + +deploy: + only: marietje-zuid + script: > + umask 077 + mkdir -p "$HOME/.ssh" + cat <"$HOME/.ssh/id_rsa" + $SSH_PRIVATE_KEY + EOF + cat <>"$HOME/.ssh/known_hosts" + marietje-zuid.science.ru.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLticd8NEr6r5QJ2VKFX/rVcfkhM3IcAr+hCgc/kgBSIPEzyRIXd74glIx17FJxvhi2KLC5D+EVtu9CSZhYSe10= + EOF + + # Upload to marietje-zuid + git push root@marietje-zuid.science.ru.nl:/srv/MarietjeDjango marietje-zuid + + # Deploy the new version + cat <