Skip to content

Instantly share code, notes, and snippets.

@myas92
Created April 25, 2022 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myas92/0cac9ca3c447ddece88c2cfcf6e1feb2 to your computer and use it in GitHub Desktop.
Save myas92/0cac9ca3c447ddece88c2cfcf6e1feb2 to your computer and use it in GitHub Desktop.
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
- cd /home/user/projects/agent
- git pull
- npm install
test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
script:
- cd /home/user/projects/agent
- npm run test
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
script:
- pm2 restart 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment