2019-07-22 19:50:18 +03:00
@Library('github.com/coreos/coreos-ci-lib@master') _
2019-12-13 20:12:53 +03:00
COSA_IMAGE = 'quay.io/coreos-assembler/coreos-assembler:latest'
COSA_BUILDROOT_IMAGE = 'registry.svc.ci.openshift.org/coreos/cosa-buildroot:latest'
2019-07-22 19:50:18 +03:00
stage("Build") {
parallel rpms: {
2019-12-13 20:12:53 +03:00
coreos.pod(image: COSA_BUILDROOT_IMAGE, runAsUser: 0) {
2019-07-22 19:50:18 +03:00
checkout scm
sh """
set -euo pipefail
2019-12-13 20:14:32 +03:00
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
git fetch origin --tags
2019-07-22 19:50:18 +03:00
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
"""
2019-12-13 20:14:32 +03:00
// make it easy for anyone to download the RPMs
archiveArtifacts 'packaging/**/*.rpm'
2019-07-22 19:50:18 +03:00
stash includes: 'packaging/**/*.rpm', name: 'rpms'
}
},
codestyle: {
2019-12-13 20:12:53 +03:00
coreos.pod(image: COSA_IMAGE) {
2019-10-03 22:14:11 +03:00
checkout scm
2019-07-22 19:50:18 +03:00
sh """
set -euo 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
2019-10-03 22:14:11 +03:00
ci/ci-commitmessage-submodules.sh
2019-07-22 19:50:18 +03:00
ci/codestyle.sh
"""
}
},
msrv: {
2019-12-13 20:12:53 +03:00
coreos.pod(image: COSA_BUILDROOT_IMAGE, runAsUser: 0) {
2019-07-22 19:50:18 +03:00
checkout scm
sh """
set -euo pipefail
2019-09-27 18:06:01 +03:00
ci/msrv.sh
2019-07-22 19:50:18 +03:00
"""
}
}}
stage("Build FCOS") {
2019-12-13 20:12:53 +03:00
coreos.pod(image: COSA_IMAGE, runAsUser: 0, kvm: true) {
2019-07-22 19:50:18 +03:00
unstash 'rpms'
sh """
set -euo pipefail
2019-12-13 20:16:40 +03:00
rpms=\$(find packaging/ ! -name '*.src.rpm' -name '*.rpm')
2019-07-22 19:50:18 +03:00
# install our built rpm-ostree
2019-12-13 20:16:40 +03:00
dnf install -y \${rpms}
2019-07-22 19:50:18 +03:00
2019-12-13 20:16:40 +03:00
# and build FCOS with our built rpm-ostree inside of it
2019-07-22 19:50:18 +03:00
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
2019-12-13 20:16:40 +03:00
mkdir -p overrides/rpm
mv \${rpms} overrides/rpm
rm -rf packaging
2019-07-22 19:50:18 +03:00
coreos-assembler build
"""
stash includes: 'builds/latest/*/*.qcow2', name: 'fcos'
}
}
/*
stage("Test") {
parallel vmcheck: {
coreos.pod(image: 'quay.io/coreos-assembler/coreos-assembler:latest', runAsUser: 0, kvm: true) {
checkout scm
unstash 'rpms'
sh """
set -euo pipefail
# install our built rpm-ostree
find packaging/ ! -name '*.src.rpm' -name '*.rpm' | xargs dnf install -y
rm -rf packaging
"""
unstash 'fcos'
sh """
set -euo pipefail
echo "standing up VMs"
find builds/ -name '*.qcow2'
"""
}
},
compose: {
coreos.pod(image: 'quay.io/coreos-assembler/coreos-assembler:latest', runAsUser: 0, kvm: true) {
checkout scm
unstash 'rpms'
sh """
set -euo pipefail
# install our built rpm-ostree
find packaging/ ! -name '*.src.rpm' -name '*.rpm' | xargs dnf install -y
rm -rf packaging
echo "starting compose tests in supermin"
"""
}
}}
*/