Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DRP_45
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wakefield, Rob
DRP_45
Commits
b75cfacf
Commit
b75cfacf
authored
1 year ago
by
Wakefield, Rob
Browse files
Options
Downloads
Plain Diff
Merge branch 'CICD' into 'production'
Add CI/CD pipeline See merge request
!1
parents
eb85758f
14c9d044
No related branches found
No related tags found
1 merge request
!1
Add CI/CD pipeline
Pipeline
#419067
passed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+40
-0
40 additions, 0 deletions
.gitlab-ci.yml
package.json
+1
-1
1 addition, 1 deletion
package.json
with
41 additions
and
1 deletion
.gitlab-ci.yml
0 → 100644
+
40
−
0
View file @
b75cfacf
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
This diff is collapsed.
Click to expand it.
package.json
+
1
−
1
View file @
b75cfacf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"scripts"
:
{
"scripts"
:
{
"dev"
:
"next dev"
,
"dev"
:
"next dev"
,
"build"
:
"next build"
,
"build"
:
"next build"
,
"start"
:
"next start"
,
"start"
:
"next start
-p $PORT
"
,
"lint"
:
"next lint"
"lint"
:
"next lint"
},
},
"dependencies"
:
{
"dependencies"
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment