forked from coreos/mantle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
64 lines (54 loc) · 1.91 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: '30', numToKeepStr: '5')),
[$class: 'CopyArtifactPermissionProperty',
projectNames: '*'],
parameters([
booleanParam(name: 'HAVE_ARM64_NODE',
defaultValue: true),
]),
pipelineTriggers([pollSCM('H/15 * * * *')])
])
def buildMantle = { String _arch ->
String arch = _arch
node("${arch} && docker") {
stage("${arch}: SCM") {
checkout scm
}
stage("${arch}: Builder") {
sh "/bin/bash -x ./docker/build-builder --rebuild"
}
stage("${arch}: Mantle") {
sh "/bin/bash -x ./docker/build-mantle"
}
stage("${arch}: Test") {
sh "/bin/bash -x ./docker/build-mantle --test"
}
stage("${arch}: Runner") {
sh "/bin/bash -x ./docker/build-runner --rebuild"
}
stage("${arch}: Post-build") {
if (env.JOB_BASE_NAME == "master-builder") {
sh "docker save \$(./docker/build-runner --tag) > mantle-runner-${arch}.tar && \
cp -v run-mantle run-mantle-${arch}"
archiveArtifacts(artifacts: "mantle-runner-${arch}.tar, run-mantle-${arch}",
fingerprint: true, onlyIfSuccessful: true)
// Legacy artifacts.
if (arch == "amd64") {
archiveArtifacts(artifacts: 'bin/**', fingerprint: true,
onlyIfSuccessful: true)
}
sh "cp -av \$(find bin -maxdepth 1 -type f) bin/${arch}/"
archiveArtifacts(artifacts: "bin/${arch}/*", fingerprint: true,
onlyIfSuccessful: true)
}
}
}
}
def build_map = [:]
build_map.failFast = false
build_map['amd64'] = buildMantle.curry('amd64')
if (params.HAVE_ARM64_NODE) {
build_map['arm64'] = buildMantle.curry('arm64')
}
parallel build_map