build_jobs: split minimal prefix out of job scripts

The chroot update/creation step must live in Jenkins but after that the
jobs can use these scripts. A template is provided in stub.sh
This commit is contained in:
Michael Marineau 2016-10-26 10:52:46 -07:00
parent 7a2fbfe67d
commit 007b57e6e5
6 changed files with 21 additions and 44 deletions

View File

@ -34,9 +34,6 @@
set -ex set -ex
# build may not be started without a ref value
[[ -n "${MANIFEST_REF#refs/tags/}" ]]
enter() { enter() {
./bin/cork enter --experimental -- "$@" ./bin/cork enter --experimental -- "$@"
} }
@ -44,11 +41,6 @@ enter() {
# hack because catalyst leaves things chowned as root # hack because catalyst leaves things chowned as root
[[ -d .cache/sdks ]] && sudo chown -R $USER .cache/sdks [[ -d .cache/sdks ]] && sudo chown -R $USER .cache/sdks
./bin/cork update --create --downgrade-replace --verify --verbose \
--manifest-url "${MANIFEST_URL}" \
--manifest-branch "${MANIFEST_REF}" \
--manifest-name "${MANIFEST_NAME}"
source .repo/manifests/version.txt source .repo/manifests/version.txt
export COREOS_BUILD_ID export COREOS_BUILD_ID

View File

@ -34,21 +34,10 @@
set -ex set -ex
# build may not be started without a ref value
[[ -n "${MANIFEST_REF#refs/tags/}" ]]
enter() { enter() {
./bin/cork enter --experimental -- "$@" ./bin/cork enter --experimental -- "$@"
} }
# hack because catalyst leaves things chowned as root
[[ -d .cache/sdks ]] && sudo chown -R $USER .cache/sdks
./bin/cork update --create --downgrade-replace --verify --verbose \
--manifest-url "${MANIFEST_URL}" \
--manifest-branch "${MANIFEST_REF}" \
--manifest-name "${MANIFEST_NAME}"
source .repo/manifests/version.txt source .repo/manifests/version.txt
export COREOS_BUILD_ID export COREOS_BUILD_ID

View File

@ -30,9 +30,6 @@
set -ex set -ex
# build may not be started without a ref value
[[ -n "${MANIFEST_REF#refs/tags/}" ]]
# use a ccache dir that persists across sdk recreations # use a ccache dir that persists across sdk recreations
# XXX: alternatively use a ccache dir that is usable by all jobs on a given node. # XXX: alternatively use a ccache dir that is usable by all jobs on a given node.
mkdir -p .cache/ccache mkdir -p .cache/ccache
@ -48,12 +45,6 @@ script() {
enter "${script}" "$@" enter "${script}" "$@"
} }
./bin/cork update --create --downgrade-replace --verify --verbose \
--manifest-url "${MANIFEST_URL}" \
--manifest-branch "${MANIFEST_REF}" \
--manifest-name "${MANIFEST_NAME}" \
-- --toolchain_boards=${BOARD}
source .repo/manifests/version.txt source .repo/manifests/version.txt
export COREOS_BUILD_ID export COREOS_BUILD_ID

View File

@ -38,9 +38,6 @@
set -ex set -ex
# build may not be started without a ref value
[[ -n "${MANIFEST_REF#refs/tags/}" ]]
# first thing, clear out old images # first thing, clear out old images
sudo rm -rf src/build sudo rm -rf src/build
@ -49,11 +46,6 @@ script() {
./bin/cork enter --experimental -- "${script}" "$@" ./bin/cork enter --experimental -- "${script}" "$@"
} }
./bin/cork update --create --downgrade-replace --verify --verbose \
--manifest-url "${MANIFEST_URL}" \
--manifest-branch "${MANIFEST_REF}" \
--manifest-name "${MANIFEST_NAME}"
source .repo/manifests/version.txt source .repo/manifests/version.txt
export COREOS_BUILD_ID export COREOS_BUILD_ID

View File

@ -48,9 +48,6 @@ set -ex
rm -f gce.properties rm -f gce.properties
sudo rm -rf tmp sudo rm -rf tmp
# build may not be started without a ref value
[[ -n "${MANIFEST_REF#refs/tags/}" ]]
# check that the matrix didn't go bananas # check that the matrix didn't go bananas
if [[ "${COREOS_OFFICIAL}" -eq 1 ]]; then if [[ "${COREOS_OFFICIAL}" -eq 1 ]]; then
[[ "${GROUP}" != developer ]] [[ "${GROUP}" != developer ]]
@ -67,11 +64,6 @@ enter() {
./bin/cork enter --experimental -- "$@" ./bin/cork enter --experimental -- "$@"
} }
./bin/cork update --create --downgrade-replace --verify --verbose \
--manifest-url "${MANIFEST_URL}" \
--manifest-branch "${MANIFEST_REF}" \
--manifest-name "${MANIFEST_NAME}"
source .repo/manifests/version.txt source .repo/manifests/version.txt
export COREOS_BUILD_ID export COREOS_BUILD_ID

21
build_jobs/stub.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
#
# This is the common job code to paste into Jenkins for everything except
# the manifest job. Update the exec line as appropriate.
set -ex
# build may not be started without a ref value
[[ -n "${MANIFEST_REF#refs/tags/}" ]]
# hack for catalyst jobs which may leave things chowned as root
#[[ -d .cache/sdks ]] && sudo chown -R $USER .cache/sdks
./bin/cork update --create --downgrade-replace --verify --verbose \
--manifest-url "${MANIFEST_URL}" \
--manifest-branch "${MANIFEST_REF}" \
--manifest-name "${MANIFEST_NAME}"
# add to packages job args which needs a full toolchain:
# -- --toolchain_boards=${BOARD}
exec ./src/scripts/build_jobs/00_job.sh