From 95021c506b8dad2eb517d0db1421f20e75a27d28 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Fri, 23 Jan 2015 10:27:05 +0100 Subject: Issue #244: Provide build-hackday-box.sh build script. - To build a fresh hackday box, just run provisioning/build-hackday-box.sh --- provisioning/build-hackday-box.sh | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 provisioning/build-hackday-box.sh (limited to 'provisioning') diff --git a/provisioning/build-hackday-box.sh b/provisioning/build-hackday-box.sh new file mode 100755 index 00000000..f4f098be --- /dev/null +++ b/provisioning/build-hackday-box.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see . + +PROVISIONING_PATH=$(dirname $0) +USER_AGENT_DIR="$PROVISIONING_PATH/.." + +PACKAGE_FILE="hackday-pixelated-user-agent.box" +BOX_NAME="hackaday-pixelated-user-agent" + +pushd $USER_AGENT_DIR + +# clear old boxes +vagrant destroy -f source +vagrant destroy -f hackday +vagrant box remove $BOX_NAME +rm "$USER_AGENT_DIR/$PACKAGE_FILE" + +# build from scratch +vagrant up source && \ +vagrant package --output "$USER_AGENT_DIR/$PACKAGE_FILE" && \ +vagrant box add $BOX_NAME $PACKAGE_FILE + +SUCCESS=$? + +popd + +if [ $SUCCESS -eq 0 ] ; then + echo + echo "Created hackday box $PACKAGE_FILE" + echo "If you want to test it, run" + echo + echo "vagrant up hackday" +else + echo "Error while building hackday box" 1>&2 +fi + +exit $SUCCESS + -- cgit v1.2.3