Skip to content

Commit

Permalink
.cci.jenkinsfile: disable testing on older RHCOS branch
Browse files Browse the repository at this point in the history
The tests won't pass because they run with latest COSA and not the
branch specific COSA. Let's just disable them for now.

(cherry picked from commit 5be9e14)
  • Loading branch information
dustymabe authored and jlebon committed Jun 18, 2024
1 parent 7be6e41 commit 239171d
Showing 1 changed file with 1 addition and 69 deletions.
70 changes: 1 addition & 69 deletions .cci.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,70 +1,2 @@
// Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md

properties([
// abort previous runs when a PR is updated to save resources
disableConcurrentBuilds(abortPrevious: true)
])

// We run `kolaTestIso` which requires at least 8Gi. Add 1Gi for overhead.
cosaPod(cpus: 4, memory: "9Gi") {
checkoutToDir(scm, 'config')

def basearch = shwrapCapture("cosa basearch")
def mechanical_streams = ['branched', 'rawhide']

shwrap("cd config && ci/validate")

shwrap("""
mkdir -p /srv/coreos && cd /srv/coreos
cosa init ${env.WORKSPACE}/config
python3 /usr/lib/coreos-assembler/download-overrides.py
# prep from the latest builds so that we generate a diff on PRs that add packages
cosa buildfetch --stream=${env.CHANGE_TARGET}
""")

// use a --parent-build arg so we can diff later and it matches prod
def parent_arg = ""
def parent_commit = ""
if (shwrapRc("test -e /srv/coreos/builds/latest/${basearch}/meta.json") == 0) {
shwrap("cp /srv/coreos/builds/latest/${basearch}/meta.json .") // readJSON wants it in the WORKSPACE
def meta = readJSON file: "meta.json"
def version = meta["buildid"]
parent_arg = "--parent-build ${version}"
parent_commit = meta["ostree-commit"]
}

// do a build. If we are operating on a mechanical stream then we
// can pin packages in lockfiles but we don't maintain a full set
// so we can't do a strict build.
def no_strict_build = false
if (env.CHANGE_TARGET in mechanical_streams) {
no_strict_build = true
}
cosaBuild(skipInit: true, noStrict: no_strict_build, extraFetchArgs: '--with-cosa-overrides', extraArgs: parent_arg)

parallel metal: {
shwrap("cd /srv/coreos && cosa buildextend-metal")
}, metal4k: {
shwrap("cd /srv/coreos && cosa buildextend-metal4k")
}

stage("Test ISO") {
shwrap("cd /srv/coreos && cosa buildextend-live")
kolaTestIso()
}

// also print the pkgdiff as a separate stage to make it more visible
if (parent_arg != "") {
stage("RPM Diff") {
shwrap("""
cd /srv/coreos
new_commit=\$(jq -r '.["ostree-commit"]' builds/latest/${basearch}/meta.json)
rpm-ostree db diff --repo tmp/repo ${parent_commit} \${new_commit} | tee tmp/diff.txt
if grep -q Downgraded tmp/diff.txt; then
echo "Downgrade detected. This is likely unintentional. If not, you may safely ignore this error."
exit 1
fi
""")
}
}
}
echo "Testing has been disabled for rhcos branches"

0 comments on commit 239171d

Please sign in to comment.