rpm-ostree/.cci.jenkinsfile
Jonathan Lebon 53cb441597 ci: Download the latest ostree even if from stable repos
Right now, rebuilding ostree into the continuous tag is manual, so we've
only been doing it when necessary to fast-track something e.g. for
rpm-ostree or cosa (see [1] for the long-term goal).

Which means when finding an ostree to use to override in our CI-built
FCOS, we should just let dnf find whatever the latest version is, even
if it's just from the regular Fedora repos.

[1] https://github.com/packit-service/packit/issues/264
2020-05-07 21:32:35 +02:00

132 lines
4.4 KiB
Plaintext

// Documentation: https://github.com/coreos/coreos-ci/blob/master/README-upstream-ci.md
stage("Build") {
parallel rpms: {
cosaPod(buildroot: true, runAsUser: 0) {
checkout scm
shwrap("""
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
git fetch origin --tags
ci/installdeps.sh
git submodule update --init
# We lose sanitizers (all the *san) here by building straight to RPMs, but we can
# restore those through a build opt later on. Being able to stash RPMs directly is
# super nice (and archiving later on will make it easy for anyone to download
# binaries from PRs in the future) and meshes well with the following stages.
export PATH="/root/.cargo/bin:\$PATH"
cargo install cbindgen
cbindgen -c rust/cbindgen.toml -o rpmostree-rust.h rust
cd packaging
make -f Makefile.dist-packaging rpm
mv \$(find . -name '*.rpm') ..
""")
// make it easy for anyone to download the RPMs
archiveArtifacts '*.rpm'
stash excludes: '*.src.rpm', includes: '*.rpm', name: 'rpms'
}
},
codestyle: {
cosaPod(buildroot: true) {
checkout scm
shwrap("""
# 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
ci/codestyle.sh
""")
}
},
rust: {
cosaPod(buildroot: true, runAsUser: 0) {
checkout scm
shwrap("ci/msrv.sh")
}
}}
stage("Test") {
parallel insttests: {
def nhosts = 6
def mem = (nhosts * 1024) + 512
cosaPod(runAsUser: 0, memory: "${mem}Mi", cpu: "${nhosts}") {
stage("Build FCOS") {
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
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
# include our built rpm-ostree in the image
mkdir -p overrides/rpm
# Let's make sure we're always composing with the latest ostree. This could be
# from the continuous repo (which for now we manually use to fast-track ostree
# builds which are needed to get rpm-ostree patches in, but eventually will be
# automated) or from the regular repos.
dnf download ostree ostree-libs --arch x86_64
mv *.rpm overrides/rpm
coreos-assembler fetch
coreos-assembler build
""")
}
stage("Install Deps") {
// really, we just need test deps, but meh...
shwrap("ci/installdeps.sh")
}
stage("Kola") {
fcosKola(cosaDir: "${env.WORKSPACE}", extraArgs: "ext.*", parallel: nhosts)
}
stage("vmcheck") {
try {
timeout(time: 30, unit: 'MINUTES') {
shwrap("""
fcos=\$(ls builds/latest/*/*.qcow2) # */
ln -sf "\$(realpath \${fcos})" tests/vmcheck/image.qcow2
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'
}
}
}
},
compose: {
def jobs = 5
def mem = (jobs * 2048) + 512
cosaPod(runAsUser: 0, memory: "${mem}Mi", cpu: "${jobs}") {
checkout scm
unstash 'rpms'
stage("Install Deps") {
shwrap("""
ci/installdeps.sh # really, we just need test deps, but meh...
dnf install -y *.rpm # install our built rpm-ostree
""")
}
stage("Run") {
try {
timeout(time: 45, unit: 'MINUTES') {
shwrap("""
mkdir -p compose-logs /srv/tmpdir
TMPDIR=/srv/tmpdir JOBS=${jobs} ./tests/compose.sh
""")
}
} finally {
shwrap("""
if [ -d compose-logs ]; then
tar -C compose-logs -cf- . | xz -c9 > compose-logs.tar.xz
fi
""")
archiveArtifacts allowEmptyArchive: true, artifacts: 'compose-logs.tar.xz'
}
}
}
}}