From ffff0fcf4b20eee454658e2a906c424d98526bb4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 1 Oct 2018 13:42:41 -0400 Subject: [PATCH] jenkins: Remove ootpa build for now It's been broken for a few reasons, recent API changes broke it, I am going to entirely rework it soon, so there's no point in having the code limp along distracting us in git master. --- Jenkinsfile.treecompose-ootpa | 116 ---------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 Jenkinsfile.treecompose-ootpa diff --git a/Jenkinsfile.treecompose-ootpa b/Jenkinsfile.treecompose-ootpa deleted file mode 100644 index 21a4ff9b..00000000 --- a/Jenkinsfile.treecompose-ootpa +++ /dev/null @@ -1,116 +0,0 @@ -def TIMER = "H/30 * * * *" -def NODE = "rhcos-jenkins" -def API_CI_REGISTRY = "registry.svc.ci.openshift.org" -def OS_NAME = "ootpa"; -def OSCONTAINER_IMG = API_CI_REGISTRY + "/rhcos/os-${OS_NAME}:latest" -def COMPOSEFLAGS = "--unified-core"; - -node(NODE) { - def par_stages = [:] - stage("Clean workspace") { - step([$class: 'WsCleanup']) - } - checkout scm - utils = load("pipeline-utils.groovy") - utils.define_properties(TIMER) - - try { - def manifest = "host-${OS_NAME}.yaml" - def manifest_data = readYaml file: "${manifest}"; - // TODO - stop using the ref in favor of oscontainer:// pivot - def ref = manifest_data.ref; - def version_prefix = manifest_data["mutate-os-release"]; - - utils.inside_assembler_container("") { - def treecompose_workdir = "${WORKSPACE}/treecompose"; - def repo = "${treecompose_workdir}/repo"; - - stage("Prepare configuration") { - utils.prepare_configuration(); - } - - stage("Pull and run oscontainer") { - withCredentials([ - usernameColonPassword(credentialsId: params.REGISTRY_CREDENTIALS, variable: 'CREDS'), - ]) { - sh """./scripts/pull-mount-oscontainer ${API_CI_REGISTRY} ${treecompose_workdir} ${OSCONTAINER_IMG}""" - } - } - - def last_build_version, force_nocache - stage("Check for Changes") { sh """ - rpm-ostree compose tree --dry-run --repo=${repo} --touch-if-changed=$WORKSPACE/build.stamp ${manifest} - """ - last_build_version = utils.get_rev_version(repo, ref) - if (fileExists('force-nocache-build')) { - force_nocache = readFile('force-nocache-build').trim(); - } - } - - if (!params.DRY_RUN && !fileExists('build.stamp') && last_build_version != force_nocache) { - echo "No changes." - currentBuild.result = 'SUCCESS' - currentBuild.description = '(No changes)' - return - } - - // Note that we don't keep history in the ostree repo, so we - // delete the ref head (so rpm-ostree won't add a parent) and - // then we do a repo prune after. - def composeMeta; - try { - stage("Compose Tree") { - sh """./scripts/run-treecompose ${repo} ${ref} ${manifest} ${COMPOSEFLAGS} --add-metadata-string=version=${version_prefix}.${env.BUILD_NUMBER}""" - composeMeta = readJSON file: "compose.json" - currentBuild.description = "🆕 ${composeMeta.version} (commit ${composeMeta.commit})"; - } - } finally { - archiveArtifacts artifacts: "pkg-diff.txt", allowEmptyArchive: true - } - - // This takes OSTree repo and copies it out of the original - // container into our working directory, which then gets put - // into a new container image. This is slow, but it's hard to do better - // with Docker/OCI images. Ideally there'd be a way to "bind mount" content - // into the build environment rather than copying. - stage("Prepare repo copy") { sh """ - original_repo=\$(readlink ${treecompose_workdir}/repo) - rm ${repo} - cp -a --reflink=auto \${original_repo} ${repo} - podman kill oscontainer - podman rm oscontainer - """ } - - stage("Build new container") { sh """ - podman build --build-arg OS_VERSION=${composeMeta.version} \ - --build-arg OS_COMMIT=${composeMeta.commit} \ - -t ${OSCONTAINER_IMG} \ - -f ${WORKSPACE}/Dockerfile.rollup ${WORKSPACE} - """ } - - if (params.DRY_RUN) { - echo "DRY_RUN set, skipping push" - currentBuild.result = 'SUCCESS' - currentBuild.description = '(dry run)' - return - } - - stage("Push container") { sh """ - podman push ${OSCONTAINER_IMG} - podman inspect --format='{{.Id}}' ${OSCONTAINER_IMG} > imgid.txt - """ - def cid = readFile('imgid.txt').trim(); - currentBuild.description = "🆕 ${OSCONTAINER_IMG}@sha256:${cid} (${composeMeta.version})"; - } - - stage("Cleanup") { sh """ - rm ${treecompose_workdir} -rf - """ } - } - } catch (Throwable e) { - currentBuild.result = 'FAILURE' - throw e - } finally { - utils.notify_status_change currentBuild - } -}