Skip to content

Commit 973719d

Browse files
Initial commit
1 parent 0058176 commit 973719d

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

Jenkinsfile

+4-37
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,24 @@
11
#!/usr/bin/groovy
2+
23
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
34
def canaryVersion = "1.0.${env.BUILD_NUMBER}"
45
def utils = new io.fabric8.Utils()
5-
def stashName = "buildpod.${env.JOB_NAME}.${env.BUILD_NUMBER}".replace('-', '_').replace('/', '_')
6-
def envStage = utils.environmentNamespace('stage')
7-
def envProd = utils.environmentNamespace('run')
86

97
mavenNode {
108
checkout scm
11-
if (utils.isCI()){
9+
if (utils.isCI()) {
1210

1311
mavenCI{}
1412

15-
} else if (utils.isCD()){
13+
} else if (utils.isCD()) {
1614
echo 'NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node'
1715
container(name: 'maven') {
18-
19-
stage('Build Release'){
16+
stage('Build Release') {
2017
mavenCanaryRelease {
2118
version = canaryVersion
2219
}
23-
//stash deployment manifests
24-
stash includes: '**/*.yml', name: stashName
25-
}
26-
27-
stage('Rollout to Stage'){
28-
apply{
29-
environment = envStage
30-
}
3120
}
3221
}
3322
}
3423
}
3524

36-
if (utils.isCD()){
37-
node {
38-
stage('Approve'){
39-
approve {
40-
room = null
41-
version = canaryVersion
42-
environment = 'Stage'
43-
}
44-
}
45-
}
46-
47-
clientsNode{
48-
container(name: 'clients') {
49-
stage('Rollout to Run'){
50-
unstash stashName
51-
apply{
52-
environment = envProd
53-
}
54-
}
55-
}
56-
}
57-
}

0 commit comments

Comments
 (0)