Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
B
building-a-multibranch-pipeline-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢宇轩
building-a-multibranch-pipeline-project
Commits
685a77b2
Commit
685a77b2
authored
Jun 21, 2022
by
谢宇轩
😅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!3
parents
646d9efd
aac318ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
15 deletions
+31
-15
Jenkinsfile
Jenkinsfile
+31
-15
No files found.
Jenkinsfile
View file @
685a77b2
pipeline
{
pipeline
{
agent
{
agent
any
docker
{
image
'node:6-alpine'
args
'-p 3000:3000 -p 5000:5000'
}
}
environment
{
environment
{
CI
=
'true'
CI
=
'true'
}
}
...
@@ -26,15 +21,7 @@ Rollback:【回滚】''',
...
@@ -26,15 +21,7 @@ Rollback:【回滚】''',
)
)
}
}
stages
{
stages
{
stage
(
'Build dev'
)
{
stage
(
'checkout'
)
{
when
{
branch
'developer'
}
steps
{
sh
'npm install'
}
}
stage
(
'Build master'
)
{
when
{
when
{
branch
'master'
branch
'master'
}
}
...
@@ -49,16 +36,39 @@ Rollback:【回滚】''',
...
@@ -49,16 +36,39 @@ Rollback:【回滚】''',
sh
"git checkout $DeployVersion"
sh
"git checkout $DeployVersion"
}
}
}
}
}
}
stage
(
'Build'
)
{
agent
{
docker
{
image
'node:6-alpine'
args
'-p 3000:3000 -p 5000:5000'
}
}
steps
{
sh
'npm install'
sh
'npm install'
}
}
}
}
stage
(
'Test'
)
{
stage
(
'Test'
)
{
agent
{
docker
{
image
'node:6-alpine'
args
'-p 3000:3000 -p 5000:5000'
}
}
steps
{
steps
{
sh
'echo "testing!"'
sh
'echo "testing!"'
echo
"test complete!"
echo
"test complete!"
}
}
}
}
stage
(
'Deliver for development'
)
{
stage
(
'Deliver for development'
)
{
agent
{
docker
{
image
'node:6-alpine'
args
'-p 3000:3000 -p 5000:5000'
}
}
when
{
when
{
branch
'developer'
branch
'developer'
}
}
...
@@ -69,6 +79,12 @@ Rollback:【回滚】''',
...
@@ -69,6 +79,12 @@ Rollback:【回滚】''',
}
}
}
}
stage
(
'Deploy for production'
)
{
stage
(
'Deploy for production'
)
{
agent
{
docker
{
image
'node:6-alpine'
args
'-p 3000:3000 -p 5000:5000'
}
}
when
{
when
{
branch
'master'
branch
'master'
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment