-
Tom Käsler authored9d693977
This GitLab CI configuration is invalid:
review job: chosen stage does not exist; available stages are .pre, test, build, deploy, .post
Learn more
Forked from an inaccessible project.
variables:
BUILD_DIR: dist
stages:
- test
- build
- deploy
tslint:
stage: test
tags:
- nodejs
allow_failure: false
dependencies: []
script:
- echo "{}" > package.json
- npm install tslint-angular
- npm install tslint-eslint-rules
- 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 ./src/**/*.ts
ngbuild:
stage: build
tags:
- angular
allow_failure: false
dependencies: []
script:
- npm install -g @angular/cli
- npm install
- ng build --prod
artifacts:
paths:
- "$BUILD_DIR"
review:
stage: review
script:
- rsync -av --delete public /srv/nginx/pages/$CI_BUILD_REF_SLUG
environment:
name: review/$CI_BUILD_REF_NAME
url: http://$CI_BUILD_REF_SLUG.$APPS_DOMAIN
on_stop: stop_review
only:
- branches
except:
- master
tags:
- nginx
stop_review:
stage: review
script:
- rm -rf public /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
- ngbuild
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"