From 288bd3103815573097b62e7caca8f73fbe120335 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 23 May 2016 14:33:27 -0300 Subject: Introduce a new option to build only core packages and skip images --- build.sh | 25 ++++++++++++++++--------- tools/build_snapshots.sh | 11 ++++++++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index c86a28a..b78808f 100755 --- a/build.sh +++ b/build.sh @@ -51,8 +51,9 @@ set +e usage() { - echo "Usage $0 [options] [ iso | nanobsd | ova | nanobsd-vga | memstick | memstickserial | memstickadi | fullupdate | all ]" + echo "Usage $0 [options] [ iso | nanobsd | ova | nanobsd-vga | memstick | memstickserial | memstickadi | fullupdate | all | none ]" echo " all = iso nanobsd nanobsd-vga memstick memstickserial memstickadi fullupdate" + echo " none = upgrade only pkg repo" echo " [ options ]: " echo " --flash-size|-f size(s) - a list of flash sizes to build with nanobsd i.e. '2g 4g'. Default: 2g" echo " --no-buildworld|-c - Will set NO_BUILDWORLD NO_BUILDKERNEL to not build kernel and world" @@ -137,7 +138,7 @@ while test "$1" != ""; do ;; --snapshots) export SNAPSHOTS=1 - IMAGETYPE="all" + IMAGETYPE=${1:-"all"} ;; --poudriere-snapshots) export POUDRIERE_SNAPSHOTS=1 @@ -195,7 +196,7 @@ while test "$1" != ""; do --do-not-upload|-u) export DO_NOT_UPLOAD=1 ;; - all|*iso*|*ova*|*memstick*|*memstickserial*|*memstickadi*|*nanobsd*|*nanobsd-vga*|*fullupdate*) + all|none|*iso*|*ova*|*memstick*|*memstickserial*|*memstickadi*|*nanobsd*|*nanobsd-vga*|*fullupdate*) BUILDACTION="images" IMAGETYPE="${1}" ;; @@ -342,7 +343,9 @@ if [ -z "${IMAGETYPE}" ]; then usage fi -if [ "$IMAGETYPE" = "all" ]; then +if [ "$IMAGETYPE" = "none" ]; then + _IMAGESTOBUILD="" +elif [ "$IMAGETYPE" = "all" ]; then _IMAGESTOBUILD="iso fullupdate nanobsd nanobsd-vga memstick memstickserial" if [ "${TARGET}" = "amd64" ]; then _IMAGESTOBUILD="${_IMAGESTOBUILD} memstickadi" @@ -476,11 +479,15 @@ if [ -n "${_bg_pids}" ]; then fi if [ -n "${SNAPSHOTS}" ]; then - snapshots_copy_to_staging_iso_updates - snapshots_copy_to_staging_nanobsd "${FLASH_SIZE}" - # SCP files to snapshot web hosting area - if [ -z "${DO_NOT_UPLOAD}" ]; then - snapshots_scp_files + if [ "${IMAGETYPE}" = "none" -a -z "${DO_NOT_UPLOAD}" ]; then + pkg_repo_rsync "${CORE_PKG_PATH}" + elif [ "${IMAGETYPE}" != "none" ]; then + snapshots_copy_to_staging_iso_updates + snapshots_copy_to_staging_nanobsd "${FLASH_SIZE}" + # SCP files to snapshot web hosting area + if [ -z "${DO_NOT_UPLOAD}" ]; then + snapshots_scp_files + fi fi # Alert the world that we have some snapshots ready. snapshots_update_status ">>> Builder run is complete." diff --git a/tools/build_snapshots.sh b/tools/build_snapshots.sh index 5297d17..cd42514 100755 --- a/tools/build_snapshots.sh +++ b/tools/build_snapshots.sh @@ -31,8 +31,9 @@ # usage() { - echo "Usage: $(basename $0) [-l] [-r] [-u] [-p]" + echo "Usage: $(basename $0) [-l] [-n] [-r] [-u] [-p]" echo " -l: Build looped operations" + echo " -n: Do not build images, only core pkg repo" echo " -p: Update poudriere repo" echo " -r: Do not reset local changes" echo " -u: Do not upload snapshots" @@ -41,14 +42,18 @@ usage() { export BUILDER_TOOLS=$(realpath $(dirname ${0})) export BUILDER_ROOT=$(realpath "${BUILDER_TOOLS}/..") +NO_IMAGES="" NO_RESET="" NO_UPLOAD="" LOOPED_SNAPSHOTS="" POUDRIERE_SNAPSHOTS="" # Handle command line arguments -while getopts lpru opt; do +while getopts lnpru opt; do case ${opt} in + n) + NO_IMAGES="none" + ;; l) LOOPED_SNAPSHOTS=1 ;; @@ -186,7 +191,7 @@ while [ /bin/true ]; do done (${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --flash-size '2g 4g' \ - --snapshots 2>&1) | while read -r LINE; do + --snapshots ${NO_IMAGES} 2>&1) | while read -r LINE; do snapshot_update_status "${LINE}" done fi -- cgit v1.1