summaryrefslogtreecommitdiffstats
path: root/tools/build_snapshots.sh
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-11-25 09:39:23 -0200
committerRenato Botelho <renato@netgate.com>2015-11-25 09:39:23 -0200
commit919c84863cbf711b9335cf265771ad8a5fe750e6 (patch)
tree5ea190b32d133aa49b85c12a6d3256c0088946ed /tools/build_snapshots.sh
parent9447077e3f9e3e90d5afd5aa223348e71cd1350a (diff)
downloadpfsense-919c84863cbf711b9335cf265771ad8a5fe750e6.zip
pfsense-919c84863cbf711b9335cf265771ad8a5fe750e6.tar.gz
Teach build_snapshots to deal with poudriere builds
Diffstat (limited to 'tools/build_snapshots.sh')
-rwxr-xr-xtools/build_snapshots.sh50
1 files changed, 37 insertions, 13 deletions
diff --git a/tools/build_snapshots.sh b/tools/build_snapshots.sh
index e1e5fab..b9b07fd 100755
--- a/tools/build_snapshots.sh
+++ b/tools/build_snapshots.sh
@@ -31,8 +31,9 @@
#
usage() {
- echo "Usage: $(basename $0) [-l] [-r] [-u]"
+ echo "Usage: $(basename $0) [-l] [-r] [-u] [-p]"
echo " -l: Build looped operations"
+ echo " -p: Update poudriere repo"
echo " -r: Do not reset local changes"
echo " -u: Do not upload snapshots"
}
@@ -43,15 +44,17 @@ export BUILDER_ROOT=$(realpath "${BUILDER_TOOLS}/..")
NO_RESET=""
NO_UPLOAD=""
LOOPED_SNAPSHOTS=""
-export minsleepvalue=${minsleepvalue:-"28800"}
-export maxsleepvalue=${maxsleepvalue:-"86400"}
+POUDRIERE_SNAPSHOTS=""
# Handle command line arguments
-while getopts lur opt; do
+while getopts lpru opt; do
case ${opt} in
l)
LOOPED_SNAPSHOTS=1
;;
+ p)
+ POUDRIERE_SNAPSHOTS=--poudriere-snapshots
+ ;;
r)
NO_RESET=1
;;
@@ -65,6 +68,13 @@ while getopts lur opt; do
esac
done
+if [ -n "${POUDRIERE_SNAPSHOTS}" ]; then
+ export minsleepvalue=${minsleepvalue:-"1800"}
+else
+ export minsleepvalue=${minsleepvalue:-"28800"}
+fi
+export maxsleepvalue=${maxsleepvalue:-"86400"}
+
# Keeps track of how many time builder has looped
export BUILDCOUNTER=0
export COUNTER=0
@@ -73,7 +83,8 @@ export COUNTER=0
export _sleeping=0
snapshot_update_status() {
- ${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --snapshot-update-status "${1}"
+ ${BUILDER_ROOT}/build.sh ${NO_UPLOAD} ${POUDRIERE_SNAPSHOTS} \
+ --snapshot-update-status "${1}"
}
git_last_commit() {
@@ -154,14 +165,27 @@ while [ /bin/true ]; do
git_last_commit
- (${BUILDER_ROOT}/build.sh --clean-builder 2>&1) | while read -r LINE; do
- snapshot_update_status "${LINE}"
- done
-
- (${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --flash-size '1g 2g 4g' \
- --snapshots 2>&1) | while read -r LINE; do
- snapshot_update_status "${LINE}"
- done
+ if [ -n "${POUDRIERE_SNAPSHOTS}" ]; then
+ (${BUILDER_ROOT}/build.sh --update-poudriere-ports 2>&1) \
+ | while read -r LINE; do
+ snapshot_update_status "${LINE}"
+ done
+
+ (${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --update-pkg-repo 2>&1) \
+ | while read -r LINE; do
+ snapshot_update_status "${LINE}"
+ done
+ else
+ (${BUILDER_ROOT}/build.sh --clean-builder 2>&1) \
+ | while read -r LINE; do
+ snapshot_update_status "${LINE}"
+ done
+
+ (${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --flash-size '1g 2g 4g' \
+ --snapshots 2>&1) | while read -r LINE; do
+ snapshot_update_status "${LINE}"
+ done
+ fi
if [ -z "${LOOPED_SNAPSHOTS}" ]; then
# only one build required, exiting
OpenPOWER on IntegriCloud