-
-
Save wavedocs/489c6f35491ab827433397a2feba34bb to your computer and use it in GitHub Desktop.
Gitlab Final Script for Deploying Your App over SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: trion/ng-cli-karma | |
cache: | |
paths: | |
- node_modules/ | |
before_script: | |
- apt-get update -qq && apt-get install -y -qq sshpass | |
deploy_stage: | |
stage: deploy | |
environment: Staging | |
only: | |
- master | |
script: | |
- rm ./package-lock.json | |
- npm install | |
- ./node_modules/@angular/cli/bin/ng test --progress false --single-run=true --watch=false | |
- ./node_modules/@angular/cli/bin/ng e2e --progress false --watch=false | |
- ./node_modules/@angular/cli/bin/ng build --progress false --prod | |
- cd dist/ | |
- ls | |
- sshpass -V | |
- export SSHPASS=$USER_PASS | |
- sshpass -e scp -o stricthostkeychecking=no -r . [email protected]:/var/www/html | |
deploy_production: | |
stage: deploy | |
environment: Production | |
only: | |
- tags | |
script: | |
- rm ./package-lock.json | |
- npm install | |
- ./node_modules/@angular/cli/bin/ng test --progress false --single-run=true --watch=false | |
- ./node_modules/@angular/cli/bin/ng e2e --progress false --watch=false | |
- ./node_modules/@angular/cli/bin/ng build --progress false --prod | |
- cd dist/ | |
- ls | |
- sshpass -V | |
- export SSHPASS=$USER_PASS | |
- sshpass -e scp -o stricthostkeychecking=no -r . [email protected]:/var/www/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment