Skip to content
Snippets Groups Projects
Commit eb496e93 authored by Wakefield, Rob's avatar Wakefield, Rob
Browse files

Merge branch 'CICD' into 'master'

Add CI/CD to master

See merge request !2
parents eb85758f d06edf11
No related branches found
No related tags found
6 merge requests!11Add Minimal std/rectr dashboard to production,!9Add shared runner dev CI,!7Merge split prod/dev CI/CD into production,!5Make small change to test pipeline,!3Merge small change into production,!2Add CI/CD to master
Pipeline #419082 waiting for manual action
cache: # Cache persists between pipelines
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- .next/
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:
- npm ci
- npm run build
- chmod u+x node_modules
rules:
- if: '$CI_COMMIT_REF_NAME == "production"' # Only run pipeline on production or when manually requested
- when: manual
tags:
- prod-runner # Use the runner with correct tag to run this pipeline
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
script:
- echo "Running unit tests..."
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *all* jobs in the test stage complete successfully.
environment: production
script:
- export PORT=80
- touch ./next.log
- sudo fuser -k $PORT/tcp || true # Kill any process running on $PORT
- sudo npm run start $PORT > ./next.log 2>&1 & # Run the web app
artifacts:
paths:
- next.log # Keep output from deploy as artifact
......@@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"start": "next start -p $PORT",
"lint": "next lint"
},
"dependencies": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment