-
Notifications
You must be signed in to change notification settings - Fork 192
/
.cci.jenkinsfile
75 lines (73 loc) · 2.21 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
// Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
stage("Build") {
parallel rpms: {
def n = 4
buildPod(memory: "4Gi", 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("""
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
# include our built rpm-ostree in the image
mkdir -p overrides/rpm
mv *.rpm overrides/rpm
coreos-assembler fetch
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: 45, 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'
}
}
}