e3375626d5
The way this tries to replace the system Rust is hacky and actually I realized belatedly I may have broken it recently; basically `installdeps.sh` re-adds the system one, and it's hard to be sure with our current buildsystem we're using the newer one from `$PATH`. What we really want to do here is use a CentOS8 buildroot, which will automatically enforce this in a better way along with solving other problems. But right now we've broken that because libdnf requires a too-new libmodulemd. So let's just rely on the Fedora rust for now.
141 lines
4.4 KiB
Plaintext
141 lines
4.4 KiB
Plaintext
// Documentation: https://github.com/coreos/coreos-ci/blob/master/README-upstream-ci.md
|
|
|
|
stage("Build") {
|
|
parallel rpms: {
|
|
def n = 5
|
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
|
checkout scm
|
|
shwrap("""
|
|
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
|
|
git fetch origin --tags
|
|
git submodule update --init
|
|
ci/installdeps.sh
|
|
ci/install-extra-builddeps.sh
|
|
# Not in the path by default
|
|
export PATH="\$HOME/.cargo/bin:\$PATH"
|
|
# Our primary CI build goes via RPM rather than direct to binaries
|
|
# to better test that path, including our vendored spec file, etc.
|
|
# The RPM build expects pre-generated bindings, so do that now.
|
|
make -f Makefile.bindings bindings
|
|
cd packaging
|
|
RPM_BUILD_NCPUS=${n} 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
|
|
""")
|
|
}
|
|
},
|
|
unit: {
|
|
// this branch runs unit tests (both Rust-based and C-based)
|
|
def n = 5
|
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
|
checkout scm
|
|
shwrap("""
|
|
MAKE_JOBS=${n} CARGO_BUILD_JOBS=${n} ci/unit.sh
|
|
""")
|
|
}
|
|
},
|
|
clang: {
|
|
// Build with clang/clang++
|
|
def n = 5
|
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
|
checkout scm
|
|
shwrap("ci/clang-build-check.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
|
|
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") {
|
|
// TODO upstream this into coreos-ci-lib
|
|
shwrap("make -C tests/kolainst install")
|
|
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: 60, 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'
|
|
}
|
|
}
|
|
}
|
|
}}
|