From 3adf0e80519acc03b9a6209b06eed671208d5c30 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 31 Jan 2020 06:38:08 +0000 Subject: [PATCH] Fix the CI deployment job to only deploy on tags --- .gitlab-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e61a92a..af10986 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,16 +29,16 @@ build: deploy: stage: deploy script: + - if [[ "$CI_COMMIT_TAG" == "" ]]; then exit 0; fi - cd dist/web-remote - zip -r ../../remote-$CI_COMMIT_TAG.zip * - - cd ../../ - - mkdir -p ~/.ssh - - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - eval $(ssh-agent -s) - - ssh-add ~/.ssh/id_rsa - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - - ssh openlp@openlp.io "mkdir -p /home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG" - - scp remote-$CI_COMMIT_TAG.zip openlp@openlp.io:/home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG/ - only: - - tags + - d ../../ + - cho "$CI_COMMIT_TAG" > version.txt + - kdir -p ~/.ssh + - cho "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + - hmod 600 ~/.ssh/id_rsa + - val $(ssh-agent -s) + - sh-add ~/.ssh/id_rsa + - '[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - sh openlp@openlp.io "mkdir -p /home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG" + - cp version.txt remote-$CI_COMMIT_TAG.zip openlp@openlp.io:/home/openlp/sites/get.openlp.org/www/remote/$CI_COMMIT_TAG/