-
Notifications
You must be signed in to change notification settings - Fork 197
/
.cci.jenkinsfile
88 lines (85 loc) · 2.8 KB
/
.cci.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
// Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
properties([
// abort previous runs when a PR is updated to save resources
disableConcurrentBuilds(abortPrevious: true)
])
stage("Build") {
parallel rpms: {
def n = 4
buildPod(memory: "6Gi", cpu: "${n}") {
checkout scm
// 2:1 job to CPU at most should keep us from getting kicked out
shwrap("""RPM_BUILD_NCPUS=${n} CARGO_BUILD_JOBS=${n} ./ci/coreosci-rpmbuild.sh""")
// make it easy for anyone to download the RPMs
archiveArtifacts '*.rpm'
stash excludes: '*-devel*.rpm,*.src.rpm', includes: '*.rpm', name: 'rpms'
}
},
codestyle: {
buildPod {
checkout scm
shwrap("""
# Ensures that we get refs to aid `git describe`
git fetch origin +refs/heads/main:refs/remotes/origin/main
ci/commit-validation.sh
""")
}
}
}
def nhosts = 4
def mem = (nhosts * 1536) + 512
cosaPod(runAsUser: 0, memory: "${mem}Mi", cpu: "${nhosts}") {
stage("Unit Tests") {
checkout scm
unstash 'rpms'
// run this stage first without installing deps, so we match exactly the cosa pkgset
// (+ our built rpm-ostree)
shwrap("""
dnf install -y *.rpm
# Cross check we enabled the unit tests
rpm-ostree --version | grep bin-unit-tests
rpm-ostree testutils c-units
""")
}
stage("Build FCOS") {
shwrap("""
chown -R -h builder: .
runuser -u builder -- coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
# include our built rpm-ostree in the image
mv *.rpm overrides/rpm
runuser -u builder -- coreos-assembler fetch
runuser -u builder -- coreos-assembler build
${env.WORKSPACE}/ci/composepost-checks.sh
""")
}
stage("Install Deps") {
shwrap("ci/install-test-deps.sh")
}
stage("Kola") {
// TODO upstream this into coreos-ci-lib
shwrap("make -C tests/kolainst install")
kola(cosaDir: "${env.WORKSPACE}", extraArgs: "ext.rpm-ostree.*", parallel: nhosts)
}
stage("vmcheck") {
try {
timeout(time: 60, unit: 'MINUTES') {
shwrap("COSA_DIR=${env.WORKSPACE} JOBS=${nhosts} tests/vmcheck.sh")
}
} finally {
shwrap("""
if [ -d vmcheck-logs ]; then
tar -C vmcheck-logs -cf- . | xz -c9 > vmcheck-logs.tar.xz
fi
""")
archiveArtifacts allowEmptyArchive: true, artifacts: 'vmcheck-logs.tar.xz'
}
}
stage("kola-upgrades") {
unstash 'rpms'
shwrap("""
coreos-installer download -p qemu -f qcow2.xz -s testing --decompress
mv rpm-ostree-[0-9]*.rpm rpm-ostree-libs-[0-9]*.rpm /usr/lib/coreos-assembler/tests/kola/rpm-ostree/destructive/data/
""")
kola(cosaDir: "${env.WORKSPACE}", skipUpgrade: true, extraArgs: "--qemu-image ./fedora-coreos*.qcow2 --tag rpm-ostree-upgrade")
}
}