Newer
Older
- deploy
tslint:
stage: test
tags:
- nodejs
allow_failure: false
dependencies: []
script:
- echo "{}" > package.json
- npm install tslint-angular
- npm install @angular/compiler
- npm install @angular/core
- npm install typescript
- npm install rxjs
- node_modules/tslint/bin/tslint -p ./tsconfig.json -c ./tslint.json --project
allow_failure: false
dependencies: []
script:
- ng build --prod --aot=false --build-optimizer=false
#review:
# stage: review
# script:
# - rsync -av --delete "$BUILD_DIR" /srv/nginx/pages/$CI_BUILD_REF_SLUG
# environment:
# name: review/$CI_BUILD_REF_NAME
# url: http://$CI_BUILD_REF_SLUG.$SERVER_URL
# on_stop: stop_review
# only:
# - branches
# except:
# - master
# tags:
# - nginx
#stop_review:
# stage: review
# script:
# - rm -rf "$BUILD_DIR" /srv/nginx/pages/$CI_BUILD_REF_SLUG
# variables:
# GIT_STRATEGY: none
# when: manual
# environment:
# name: review/$CI_BUILD_REF_NAME
# action: stop
# tags:
# - nginx
deploy:
stage: deploy
only:
- master
tags:
- ssh
dependencies:
- tslint
script:
- eval $(ssh-agent -s)
- mkdir ~/.ssh #&& echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- ssh-keyscan "$SERVER_URL" >> ~/.ssh/known_hosts
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- scp -r "$BUILD_DIR"* "$SSH_URL"