web-remote/.gitlab-ci.yml

45 lines
1.0 KiB
YAML
Raw Normal View History

image: openlp/angular
2018-08-23 06:36:44 +00:00
stages:
- test
- build
- deploy
before_script:
- yarn install
lint:
stage: test
script:
- yarn lint
test:
2018-08-23 06:36:44 +00:00
stage: test
script:
- yarn test --no-progress --no-watch --browsers=ChromiumHeadlessCI
build:
stage: build
script:
- yarn build --no-progress --prod --aot
artifacts:
paths:
- dist/
deploy:
stage: deploy
script:
- if [[ "$CI_COMMIT_TAG" == "" ]]; then exit 0; fi
- cd dist/web-remote
- zip -r ../../remote-$CI_COMMIT_TAG.zip *
- 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/