108 lines
3.5 KiB
Plaintext
108 lines
3.5 KiB
Plaintext
// Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
|
|
|
|
stage("Build") {
|
|
parallel rpms: {
|
|
def n = 5
|
|
buildPod(memory: "2Gi", 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
|
|
mv packaging/*/*.rpm .
|
|
""")
|
|
// make it easy for anyone to download the RPMs
|
|
archiveArtifacts '*.rpm'
|
|
stash excludes: '*.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
|
|
""")
|
|
}
|
|
}
|
|
}
|
|
|
|
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
|
|
# for now, we cherry-pick newer libsolv to test that it correctly detects our rpmdb
|
|
# https://github.com/coreos/rpm-ostree/issues/2548
|
|
(cd overrides/rpm && curl -LO https://kojipkgs.fedoraproject.org//packages/libsolv/0.7.17/1.fc33/x86_64/libsolv-0.7.17-1.fc33.x86_64.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")
|
|
fcosKola(cosaDir: "${env.WORKSPACE}", extraArgs: "ext.*", parallel: nhosts)
|
|
}
|
|
stage("vmcheck") {
|
|
try {
|
|
timeout(time: 30, 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'
|
|
}
|
|
}
|
|
}
|
|
},
|
|
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/install-test-deps.sh
|
|
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'
|
|
}
|
|
}
|
|
}
|
|
}}
|