Merge branch 'deploy-only-tags' into 'master'

Fix the CI deployment job to only deploy on tags

See merge request openlp/web-remote!10
This commit is contained in:
Raoul Snyman 2020-01-31 06:38:08 +00:00
commit 1a7bed1519

View File

@ -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/