Merge pull request #104 from marineam/build

add(build_container): New catalyst script for buildbot containers.
This commit is contained in:
Michael Marineau 2013-09-02 10:29:03 -07:00
commit 73f5cbff40
3 changed files with 61 additions and 2 deletions

45
build_container Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
#
# Copyright (c) 2013 The CoreOS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
TYPE="coreos-buildbot"
ARCH=$(portageq envvar ARCH)
DEFAULT_SEED="builds/coreos-sdk/stage4-${ARCH}-latest.tar.bz2"
DEFAULT_PROFILE="coreos:default/linux/${ARCH}/10.0"
FORCE_STAGES="stage4"
. "${SCRIPT_ROOT}/lib/catalyst.sh" || exit 1
# include upload options
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
## Define the stage4 config template
catalyst_stage4() {
cat <<EOF
target: stage4
pkgcache_path: $BINPKGS
stage4/packages: coreos-devel/buildhost-depends
stage4/fsscript: ${SCRIPT_ROOT}/lib/catalyst_buildbot_stage4.sh
EOF
catalyst_stage_default
}
catalyst_init "$@"
check_gsutil_opts
if [[ "$STAGES" =~ stage4 ]]; then
info "Setting release to ${COREOS_VERSION_STRING}"
rm -rf "${TEMPDIR}/stage4_overlay"
mkdir -p "${TEMPDIR}/stage4_overlay"
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
--root "${TEMPDIR}/stage4_overlay" \
--production_track sdk --board "${ARCH}-host"
fi
catalyst_build
command_completed

View File

@ -10,8 +10,14 @@
: ${TYPE:="coreos-sdk"} : ${TYPE:="coreos-sdk"}
: ${ARCH:=$(portageq envvar ARCH)} : ${ARCH:=$(portageq envvar ARCH)}
: ${DEFAULT_CATALYST_ROOT:="${DEFAULT_BUILD_ROOT}/catalyst"} : ${DEFAULT_CATALYST_ROOT:="${DEFAULT_BUILD_ROOT}/catalyst"}
: ${DEFAULT_SEED:="${DEFAULT_CATALYST_ROOT}/builds/${TYPE}/stage4-${ARCH}-latest.tar.bz2"} : ${DEFAULT_SEED:="builds/${TYPE}/stage4-${ARCH}-latest.tar.bz2"}
: ${DEFAULT_PROFILE:="coreos:default/linux/${ARCH}/10.0"} : ${DEFAULT_PROFILE:="coreos:default/linux/${ARCH}/10.0"}
# Set to something like "stage4" to restrict what to build
# FORCE_STAGES=
if [[ "${DEFAULT_SEED}" != /* ]]; then
DEFAULT_SEED="${DEFAULT_CATALYST_ROOT}/${DEFAULT_SEED}"
fi
# Values set in catalyst_init, don't use till after calling it # Values set in catalyst_init, don't use till after calling it
CATALYST_ROOT= CATALYST_ROOT=
@ -136,7 +142,9 @@ catalyst_init() {
switch_to_strict_mode switch_to_strict_mode
eval set -- "${FLAGS_ARGV}" eval set -- "${FLAGS_ARGV}"
if [[ $# -eq 0 ]]; then if [[ -n "${FORCE_STAGES}" ]]; then
STAGES="${FORCE_STAGES}"
elif [[ $# -eq 0 ]]; then
STAGES="stage1 stage2 stage3 stage4" STAGES="stage1 stage2 stage3 stage4"
else else
for stage in "$@"; do for stage in "$@"; do

View File

@ -0,0 +1,6 @@
#!/bin/bash
source /tmp/chroot-functions.sh
echo "Double checking everything is fresh and happy."
run_merge -uDN --with-bdeps=y world