Last active
February 24, 2019 15:08
-
-
Save Rayjax/ef07ef029b19a0312808deee89d202a1 to your computer and use it in GitHub Desktop.
Sample gitlab ci file for node-ci project
This file contains hidden or 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: node:6.10.3 | |
stages: | |
- ver | |
- init | |
- tests | |
- deploy | |
ver: | |
stage: ver | |
script: | |
- node --version | |
- whoami | |
init: | |
stage: init | |
script: | |
- npm cache clean | |
- rm -rf node-modules | |
- npm install | |
run_tests: | |
stage: tests | |
script: | |
- npm test | |
deploy_staging: | |
stage: deploy | |
script: | |
- git remote add heroku https://heroku:[email protected]/gitlab-node-ci-staging.git | |
- git push heroku master | |
- echo "Deployed to staging server" | |
environment: | |
name: staging | |
url: https://gitlab-node-ci-staging.herokuapp.com/ | |
only: | |
- master | |
deploy_production: | |
stage: deploy | |
script: | |
- git remote add heroku https://heroku:[email protected]/gitlab-node-ci.git | |
- git push heroku master | |
- echo "Deployed to production server" | |
environment: | |
name: production | |
url: https://gitlab-node-ci.herokuapp.com/ | |
when: manual | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment