forked from coreos/ignition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
64 lines (52 loc) · 1.4 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
#!groovy
properties([
buildDiscarder(logRotator(daysToKeepStr: '20', numToKeepStr: '30')),
pipelineTriggers([pollSCM('H/15 * * * *')])
])
def test_ignition(ARCH, GOVERSION)
{
node("${ARCH} && docker") {
def CGO = (ARCH == 'arm64') ? 1 : 0
withEnv(["TARGET=${ARCH}", "CGO_ENABLED=${CGO}",
"GOARCH=${ARCH}", "GOVERSION=${GOVERSION}"]) {
stage("SCM $GOVERSION") {
checkout scm
}
stage("Build & Test $GOVERSION") {
sh '''#!/bin/bash -ex
sudo chmod +x docker_build
sudo chmod +x test
sudo chmod +x build
sudo chmod +x coreos_test
'''
withDockerContainer("quay.io/slowrie/ignition-builder-${GOVERSION}") {
sh '''#!/bin/bash
if [ "${TARGET}" == "amd64" ]; then
export ACTION="COMPILE"
GOARCH="${TARGET}" ./test;
elif [ "${TARGET}" == "arm64" ]; then
export CGO_LDFLAGS="-L ${PWD}";
GOARCH="${TARGET}" ./build;
file "bin/${TARGET}/ignition" | egrep 'aarch64';
fi
'''
}
sh '''#!/bin/bash -ex
PATH=$PATH:$PWD/bin/amd64
OUT=$(sudo -E PATH=$PATH find -name "*.test" -exec '{}' ';')
echo $OUT
if [ "${OUT#*FAIL}" != "$OUT" ]; then
exit 1
fi
'''
}
}
}
}
def archs = ['amd64']
def govers = ['1.7', '1.8']
for (String arch : archs) {
for (String gover : govers) {
test_ignition(arch, gover)
}
}