forked from ostreedev/ostree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cci.jenkinsfile
118 lines (111 loc) · 3.38 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
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
// See https://github.com/jlebon/coreos-ci
// This was originally copied from the rpm-ostree one
@Library('github.com/coreos/coreos-ci-lib@master') _
COSA_IMAGE = 'quay.io/coreos-assembler/coreos-assembler:latest'
COSA_BUILDROOT_IMAGE = 'registry.svc.ci.openshift.org/coreos/cosa-buildroot:latest'
stage("Build") {
parallel normal: {
coreos.pod(image: COSA_BUILDROOT_IMAGE, runAsUser: 0) {
checkout scm
stage("Core build") {
sh """
set -xeuo pipefail
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
git fetch origin --tags
git submodule update --init
env SKIP_INSTALLDEPS=1 ./ci/build.sh
"""
}
stage("Unit tests") {
try {
sh """
make check
make syntax-check
"""
} finally {
archiveArtifacts allowEmptyArchive: true, artifacts: 'test-suite.log'
}
}
sh """
make install DESTDIR=\$(pwd)/insttree/
tar -c -C insttree/ -zvf insttree.tar.gz .
"""
stash includes: 'insttree.tar.gz', name: 'build'
}
},
// A minimal build, helps test our build options
minimal: {
coreos.pod(image: COSA_BUILDROOT_IMAGE, runAsUser: 0) {
checkout scm
sh """
set -xeuo pipefail
git submodule update --init
env NOCONFIGURE=1 ./autogen.sh
./configure --without-curl --without-soup --disable-gtk-doc --disable-man \
--disable-rust --without-libarchive --without-selinux --without-smack \
--without-openssl --without-avahi --without-libmount --disable-rofiles-fuse \
--disable-experimental-api
make
"""
}
},
codestyle: {
coreos.pod(image: COSA_IMAGE) {
checkout scm
sh """
set -xeuo pipefail
# Jenkins by default only fetches the branch it's testing. Explicitly fetch master
# for ci-commitmessage-submodules.sh
git fetch origin +refs/heads/master:refs/remotes/origin/master
ci/ci-commitmessage-submodules.sh
"""
}
}
}
// Build FCOS and do a kola basic run
stage("More builds and test") {
parallel fcos: {
coreos.pod(image: COSA_IMAGE, runAsUser: 0, kvm: true, memory: "2048Mi", cpu: "2") {
stage("Build FCOS") {
checkout scm
unstash 'build'
sh """
set -xeuo pipefail
mkdir insttree
tar -C insttree -xzvf insttree.tar.gz
rsync -rlv insttree/ /
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
mkdir -p overrides/rootfs
mv insttree/* overrides/rootfs/
rmdir insttree
coreos-assembler build
"""
}
stage("FCOS basic") {
timeout(time: 30, unit: 'MINUTES') {
sh """
set -xeuo pipefail
cosa kola run --basic-qemu-scenarios
"""
}
}
}
},
buildopts: {
coreos.pod(image: COSA_BUILDROOT_IMAGE, runAsUser: 0) {
checkout scm
sh """
set -xeuo pipefail
git submodule update --init
git worktree add build-rust && cd build-rust
env CONFIGOPTS="--enable-rust" SKIP_INSTALLDEPS=1 ./ci/build.sh
make check TESTS=tests/test-rollsum
cd .. && rm -rf build-rust
git worktree add build-libsoup && cd build-libsoup
env CONFIGOPTS="--without-curl --without-openssl --with-soup" SKIP_INSTALLDEPS=1 ./ci/build.sh
make check
cd .. && rm -rf build-libsoup
"""
}
}
}