Skip to content

Commit e637af5

Browse files
rohitkrai03openshiftio-launchpad
authored andcommitted
Adding pipeline
1 parent 7d21d91 commit e637af5

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

Jenkinsfile

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/groovy
2+
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
3+
def canaryVersion = "1.0.${env.BUILD_NUMBER}"
4+
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')
8+
9+
mavenNode {
10+
checkout scm
11+
if (utils.isCI()){
12+
13+
mavenCI{}
14+
15+
} else if (utils.isCD()){
16+
echo 'NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node'
17+
container(name: 'maven') {
18+
19+
stage('Build Release'){
20+
mavenCanaryRelease {
21+
version = canaryVersion
22+
}
23+
//stash deployment manifests
24+
stash includes: '**/*.yml', name: stashName
25+
}
26+
27+
stage('Rollout to Stage'){
28+
apply{
29+
environment = envStage
30+
}
31+
}
32+
}
33+
}
34+
}
35+
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)