2019-10-06 00:28:36 +00:00
|
|
|
image: openlp/angular
|
2018-08-23 06:36:44 +00:00
|
|
|
|
2019-10-06 00:28:36 +00:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
lint:
|
|
|
|
stage: test
|
|
|
|
script:
|
2020-02-25 22:43:24 +00:00
|
|
|
- yarn install
|
2019-10-06 00:28:36 +00:00
|
|
|
- yarn lint
|
2020-02-25 22:43:24 +00:00
|
|
|
except:
|
|
|
|
- tags
|
2019-10-06 00:28:36 +00:00
|
|
|
|
|
|
|
test:
|
2018-08-23 06:36:44 +00:00
|
|
|
stage: test
|
|
|
|
script:
|
2020-02-25 22:43:24 +00:00
|
|
|
- yarn install
|
2019-10-06 00:28:36 +00:00
|
|
|
- yarn test --no-progress --no-watch --browsers=ChromiumHeadlessCI
|
2020-02-25 22:43:24 +00:00
|
|
|
except:
|
|
|
|
- tags
|
2019-10-06 00:28:36 +00:00
|
|
|
|
2022-12-31 20:27:25 +00:00
|
|
|
build-branch:
|
2019-10-06 00:28:36 +00:00
|
|
|
stage: build
|
|
|
|
script:
|
2020-02-25 22:43:24 +00:00
|
|
|
- yarn install
|
2022-12-31 20:27:25 +00:00
|
|
|
- yarn build --no-progress --configuration production --aot
|
|
|
|
- export APP_VERSION=`git describe --dirty --tags --long --match '*[0-9]*'`
|
|
|
|
- 'echo "window.appVersion = \"$APP_VERSION\";" > dist/web-remote/assets/version.js'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/
|
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
|
|
|
|
build-tag:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- yarn install
|
|
|
|
- yarn build --no-progress --configuration production --aot
|
|
|
|
- 'echo "window.appVersion = \"$CI_COMMIT_TAG\";" > dist/web-remote/assets/version.js'
|
2019-10-06 00:28:36 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/
|
2020-02-25 22:43:24 +00:00
|
|
|
only:
|
|
|
|
- tags
|
2019-10-06 00:28:36 +00:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
stage: deploy
|
|
|
|
script:
|
|
|
|
- cd dist/web-remote
|
|
|
|
- zip -r ../../remote-$CI_COMMIT_TAG.zip *
|
2020-02-25 22:43:24 +00:00
|
|
|
- cd ../../
|
|
|
|
- export CHECK_SUM=`sha256sum remote-$CI_COMMIT_TAG.zip | cut -d' ' -f1`
|
|
|
|
- export FILE_SIZE=`stat -c '%s' remote-$CI_COMMIT_TAG.zip`
|
2022-02-10 22:16:36 +00:00
|
|
|
- 'echo -e "{\"latest\": {\"version\": \"$CI_COMMIT_TAG\", \"sha256\": \"$CHECK_SUM\", \"filename\": \"remote-$CI_COMMIT_TAG.zip\", \"size\": $FILE_SIZE}}" > version-$CI_COMMIT_TAG.json'
|
2020-02-25 22:43:24 +00:00
|
|
|
- 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/
|
2022-02-10 22:16:36 +00:00
|
|
|
- scp version-$CI_COMMIT_TAG.json openlp@openlp.io:/home/openlp/sites/get.openlp.org/www/remote/
|
|
|
|
- ssh openlp@openlp.io "rm /home/openlp/sites/get.openlp.org/www/remote/version.json"
|
|
|
|
- scp version-$CI_COMMIT_TAG.json openlp@openlp.io:/home/openlp/sites/get.openlp.org/www/remote/version.json
|
2020-02-25 22:43:24 +00:00
|
|
|
only:
|
|
|
|
- tags
|