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