-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetworkerBuild.groovy
More file actions
207 lines (179 loc) · 5.28 KB
/
NetworkerBuild.groovy
File metadata and controls
207 lines (179 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import groovy.transform.Field
def checkoutArches = ["solarissparc", "nt86"]
def cleanArches = ["solarissparc", "aixpower", "nt86"]
def mkdirsArches = ["solarissparc", "aixpower", "nt86"]
def buildArches = ["solarissparc", "aixpower", "aixpower32"]
def checkoutArchesMap = checkoutArches.collectEntries {
["${it}" : generateStage(it,'checkout')]
}
def cleanArchesMap = cleanArches.collectEntries {
["${it}" : generateStage(it,'clean')]
}
def mkdirsArchesMap = mkdirsArches.collectEntries {
["${it}" : generateStage(it,'mkdirs')]
}
def buildArchesMap = buildArches.collectEntries {
["${it}" : generateStage(it,'build')]
}
def generateStage(arch,step) {
return {
if(step == 'checkout'){
stage("stage: ${arch}") {
echo "Build running on ${arch}."
RunShCmd("perl /disks/sc_renas_nwmasterzone/build/nw_checkout.pl --ARCH=${arch} --BUILDZONE=${product} --debug=on ${branch}")
}
}
if(step == 'clean'){
stage("stage: ${arch}") {
echo "Clean running on ${arch}."
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nwmigration/buildCleanfinal.pl --arch=${arch} --branch=${branch}" )
}
}
if(step == 'mkdirs'){
stage("stage: ${arch}") {
echo "Mkdirs running on ${arch}."
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nwmigration/mkdirs.pl --arch=${arch} --branch=${branch}" )
}
}
if(step == 'build'){
stage("stage: ${arch}") {
echo "Build running on ${arch}."
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nw_build.pl --ARCH=${arch} --BUILDZONE=${product} --debug=on ${branch}" )
}
}
}
}
def RunShCmd(String cmd) {
Cmd_Status = sh (returnStatus: true, script: cmd)
}
pipeline {
agent { label 'LAUNCHER' }
stages {
stage('Prebuild') {
steps {
script {
echo "Branch Selected = '${branch}'\n"
}
}
}
stage('Checkout') {
failFast true
steps {
script {
echo "Checkout step started.\n"
parallel checkoutArchesMap
echo "Checkout step completed.\n"
}
}
}
stage('History') {
steps {
echo "History step started.\n"
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nw_history.pl --BUILDZONE=${product} --debug=on ${branch}" )
echo "History step completed.\n"
}
}
stage('Clean') {
failFast true
steps {
script {
echo "Clean step started.\n"
parallel cleanArchesMap
echo "Clean step completed.\n"
}
}
}
stage('mkdirs') {
steps {
script {
echo "mkdirs step started.\n"
parallel mkdirsArchesMap
echo "mkdirs step completed.\n"
}
}
}
stage('Build') {
steps {
script {
echo "Build step started.\n"
parallel buildArchesMap
echo "Build step completed.\n"
}
}
}
stage("Cstyle"){
steps{
script {
echo "Cstyle step started.\n"
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nw_cstyle.pl --ARCH=${'solarisx64'} --BUILDZONE=${product} --debug=on ${branch}" )
echo "Cstyle step completed.\n"
}
}
}
stage('Output') {
steps {
script {
echo "Output step started.\n"
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nw_output.pl --ARCH=${'generic'} --BUILDZONE=${product} --debug=on ${branch}" )
echo "Output step completed.\n"
}
}
}
stage('RelClean') {
steps {
script {
echo "RelClean step started.\n"
RunShCmd( "perl /disks/sc_renas_nwmasterzone/build/nw_relclean.pl --ARCH=${'generic'} --BUILDZONE=${product} --debug=on ${branch}" )
echo "RelClean step completed.\n"
}
}
}
stage('pre_package') {
when {
expression { params.REL_CAND == true }
}
steps {
script {
echo " Add code for pre_package \n"
}
}
}
stage('post_package') {
when {
expression { params.REL_CAND == true }
}
steps {
script {
echo " Add code for post_package \n"
}
}
}
stage('Images') {
steps {
script {
echo "Images step started.\n"
RunShCmd( "ssh build@zipi perl /disks/nasbld/master/build/nw_images.pl --ARCH=${'solarissparc'} --BUILDZONE=${product} --debug=on ${branch}" )
echo "Images step completed.\n"
}
}
}
stage('CheckLog') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "exit 1"
}
}
}
}
post {
success {
echo 'SUCCESS'
}
unstable {
echo 'UNSTABLE'
}
failure {
echo 'FAILURE'
}
}
}