This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
180 lines (177 loc) · 5.87 KB
/
Jenkinsfile
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
properties([
parameters([
choiceParam(
name: 'ARCH',
choices: "x86_64\nppc64le\naarch64",
description: 'Architecture'
),
string(
name: 'OS_BUILD_ENV_IMAGE',
description: 'openshift-release image',
defaultValue: 'openshiftmultiarch/origin-release:golang-1.8'
)
])
])
library identifier: "multiarch-openshift-ci@master",
retriever: modernSCM([$class: 'GitSCMSource',
remote: "https://github.com/CentOS-PaaS-SIG/multiarch-openshift-ci"])
node("paas-sig-ci-slave01") {
ansiColor('xterm') {
timestamps {
withEnv(["PROVISION_STAGE_NAME=provision", "DEPROVISION_STAGE_NAME=deprovision"]) {
stage('pre') {
checkout(
changelog: true,
poll: true,
scm: [
$class: 'GitSCM',
branches: [
[name:'origin/master']
],
doGenerateSubmoduleConfigurations: false,
browser: [
$class: 'GithubWeb',
repoUrl: 'https://github.com/openshift/origin'
],
extensions: [
[$class: 'CleanBeforeCheckout'],
[$class: 'RelativeTargetDirectory', relativeTargetDir:'origin']
],
gitTool: 'Default',
submoduleCfg: [],
userRemoteConfigs: [
[
name: 'origin',
refspec: '+refs/heads/master:refs/remotes/origin/master',
url:'https://github.com/openshift/origin.git'
],
[
name: 'detiber',
refspec: '+refs/heads/multiarch:refs/remotes/detiber/multiarch',
url:'https://github.com/detiber/origin.git'
]
]
]
)
sh('''#!/usr/bin/bash -xeu
pushd origin
git merge detiber/multiarch
popd
''')
}
withCiHost {
stage('prep') {
remoteCommands([
"yum install -y rsync docker git",
"echo 'insecure_registries: [172.30.0.0/16]' >> /etc/containers/registries.conf",
"systemctl enable docker",
"systemctl start docker"
])
remoteSync(['origin'])
}
def failed_stages = []
try {
stage('check') {
try {
remoteCommands([
"cd origin; OS_BUILD_ENV_IMAGE=${OS_BUILD_ENV_IMAGE} hack/env TEST_KUBE=true JUNIT_REPORT=true DETECT_RACES=false TIMEOUT=300s make check -j -k"
])
}
catch (exc) {
throw exc
}
finally {
fetchScriptOutput()
archiveArtifacts 'origin/_output/scripts/**/*'
junit 'origin/_output/scripts/**/*.xml'
}
}
}
catch (exc) {
failed_stages += 'check'
}
try {
stage('build release') {
try {
remoteCommands([
"cd origin; OS_BUILD_ENV_IMAGE=${OS_BUILD_ENV_IMAGE} hack/env hack/build-base-images.sh",
"cd origin; OS_BUILD_ENV_IMAGE=${OS_BUILD_ENV_IMAGE} hack/env JUNIT_REPORT=true make release"
])
}
catch (exc) {
throw exc
}
finally {
fetchScriptOutput()
archiveArtifacts 'origin/_output/scripts/**/*'
junit 'origin/_output/scripts/**/*.xml'
}
}
}
catch (exc) {
failed_stages += 'build release'
}
try {
stage('integration') {
try {
remoteCommands([
"cd origin; OS_BUILD_ENV_IMAGE=${OS_BUILD_ENV_IMAGE} hack/env JUNIT_REPORT=true TIMEOUT=300s make test-tools test-integration"
])
}
catch (exc) {
throw exc
}
finally {
fetchScriptOutput()
archiveArtifacts 'origin/_output/scripts/**/*'
junit 'origin/_output/scripts/**/*.xml'
}
}
}
catch (exc) {
failed_stages += 'integration'
}
try {
stage('e2e') {
try {
def go_arch
switch(params.ARCH) {
case "x86_64":
go_arch="amd64"
break
case "aarch64":
go_arch="arm64"
break
default:
go_arch=params.ARCH
break
}
remoteCommands([
"cd origin; OS_BUILD_ENV_IMAGE=${OS_BUILD_ENV_IMAGE} hack/env JUNIT_REPORT=true OS_BUILD_ENV_PRESERVE=_output/local/bin/linux/${go_arch}/end-to-end.test hack/env make build-router-e2e-test",
"cd origin; OS_BUILD_ENV_IMAGE=${OS_BUILD_ENV_IMAGE} hack/env JUNIT_REPORT=true OS_BUILD_ENV_PRESERVE=_output/local/bin/linux/${go_arch}/etcdhelper hack/env make build WHAT=tools/etcdhelper",
"OPENSHIFT_SKIP_BUILD='true' JUNIT_REPORT='true' make test-end-to-end -o build"
])
}
catch (exc) {
throw exc
}
finally {
fetchScriptOutput()
archiveArtifacts 'origin/_output/scripts/**/*'
junit 'origin/_output/scripts/**/*.xml'
}
}
}
catch (exc) {
failed_stages += 'e2e'
}
sh('''#!/usr/bin/bash -xeu
pushd origin
make clean
popd
''')
}
}
}
}
}