Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 119 lines (95 sloc) 3.14 KB
#!/bin/bash -e
# Copyright (c) 2011-2015 TurnKey GNU/Linux - http://www.turnkeylinux.org
#
# This file is part of buildtasks.
#
# Buildtasks 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.
fatal() { echo "FATAL [$(basename $0)]: $@" 1>&2; exit 1; }
warning() { echo "WARNING [$(basename $0)]: $@"; }
info() { echo "INFO [$(basename $0)]: $@"; }
usage() {
cat<<EOF
Syntax: $(basename $0) [ --publish ] appname
Builds appliance appname (e.g., core) ISO
Arguments::
appname - e.g., core
Options::
--publish - publish iso, release files and tklbam profile
Environment::
BT_DEBUG - turn on debugging
EOF
exit 1
}
while [ "$1" != "" ]; do
case $1 in
--help|-h ) usage;;
--publish) publish="yes";;
*) if [ -n "$appname" ]; then usage; else appname=$1; fi ;;
esac
shift
done
[ -n "$appname" ] || usage
[ -n "$BT_DEBUG" ] && set -x
# temporary hack for building v15.0rc isos on v14.2 TKLDev
if [ -n "$(grep jessie /etc/turnkey_version)" ]; then
export RELEASE="debian/stretch"
GPGKEY="A16EB94D"
IMAGES="http://mirror.turnkeylinux.org/turnkeylinux/images"
BOOTSTRAP_NAME="bootstrap-stretch-$(dpkg --print-architecture)"
BOOTSTRAP_PATH="$FAB_PATH/bootstraps/stretch"
if [ ! -d $BOOTSTRAP_PATH ]; then
info "downloading $BOOTSTRAP_NAME"
mkdir -p $(dirname $BOOTSTRAP_PATH)
cd $(dirname $BOOTSTRAP_PATH)
wget -nc $IMAGES/bootstrap/$BOOTSTRAP_NAME.tar.gz
wget -nc $IMAGES/bootstrap/$BOOTSTRAP_NAME.tar.gz.hash
info "verifying $BOOTSTRAP_NAME"
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 0x$GPGKEY
gpg --verify $BOOTSTRAP_NAME.tar.gz.hash
info "unpacking $BOOTSTRAP_NAME"
mkdir $BOOTSTRAP_PATH
tar -zxf $BOOTSTRAP_NAME.tar.gz -C $BOOTSTRAP_PATH
cd -
fi
fi
export BT=$(dirname $(readlink -f $0))
export BT_CONFIG=$BT/config
. $BT_CONFIG/common.cfg
if [ "$publish" == "yes" ]; then
[ -n "$BT_PUBLISH_IMGS" ] || fatal "BT_PUBLISH_IMGS not set"
[ -n "$BT_PUBLISH_META" ] || fatal "BT_PUBLISH_META not set"
[ -n "$BT_PUBLISH_PROFILES" ] || fatal "BT_PUBLISH_PROFILES not set"
else
warning "--publish was not specified"
fi
if [ ! -e $BT_PRODUCTS/$appname ]; then
cd $BT_PRODUCTS
git clone https://github.com/turnkeylinux-apps/$appname.git
cd $BT_PRODUCTS/$appname
else
cd $BT_PRODUCTS/$appname
git pull
fi
deck -D build/root.sandbox || true
make clean || true
make || true
if [ ! -e build/product.iso ]; then
if [ -z "$BT_DEBUG" ]; then
deck -D build/root.sandbox >/dev/null 2>&1 || true
make clean >/dev/null 2>&1 || true
fi
fatal "build failed..."
fi
mkdir -p $BT_ISOS
$BT/bin/iso-release --force $BT_ISOS
if [ "$publish" == "yes" ]; then
name=$(cat build/root.sandbox/etc/turnkey_version)
$BT/bin/iso-publish $BT_ISOS/$name.iso
fi
if [ -z "$BT_DEBUG" ]; then
deck -D build/root.sandbox
make clean
fi
You can’t perform that action at this time.