diff --git a/build_jobs/01_manifest.sh b/build_jobs/01_manifest.sh new file mode 100644 index 0000000000..4ad75e4d1c --- /dev/null +++ b/build_jobs/01_manifest.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# +# Jenkins job for creating build manifests. +# +# Input Parameters: +# +# MANIFEST_REF=master +# Git branch or tag in github.com/coreos/manifest to build +# +# LOCAL_MANIFEST= +# Repo local manifest to amend the branch's default manifest with. +# https://wiki.cyanogenmod.org/w/Doc:_Using_manifests#The_local_manifest +# +# Input Artifacts: +# +# $WORKSPACE/bin/cork from a recent mantle build. +# +# Git: +# +# github.com/coreos/manifest checked out to $WORKSPACE/manifest +# SSH push access to github.com/coreos/manifest-builds +# +# Output: +# +# Pushes build tag to manifest-builds. +# Writes manifest.properties w/ parameters for sdk and toolchain jobs. + +set -ex + +export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" + +finish() { + local tag="$1" + git -C "${WORKSPACE}/manifest" push \ + "ssh://git@github.com/coreos/manifest-builds.git" \ + "refs/tags/${tag}:refs/tags/${tag}" + tee "${WORKSPACE}/manifest.properties" <.repo/local_manifests/local.xml <<<"${LOCAL_MANIFEST}" +fi + +./bin/cork update --create --downgrade-replace --verbose \ + --manifest-url "${GIT_URL}" \ + --manifest-branch "${GIT_COMMIT}" \ + --manifest-name "${MANIFEST_NAME}" \ + --new-version "${COREOS_VERSION}" \ + --sdk-version "${COREOS_SDK_VERSION}" + +./bin/cork enter --experimental -- sh -c \ + "pwd; repo manifest -r > '/mnt/host/source/manifest/${COREOS_BUILD_ID}.xml'" + +cd manifest +git add "${COREOS_BUILD_ID}.xml" + +ln -sf "${COREOS_BUILD_ID}.xml" default.xml +ln -sf "${COREOS_BUILD_ID}.xml" release.xml +git add default.xml release.xml + +tee version.txt <