-
Notifications
You must be signed in to change notification settings - Fork 19
/
bt-optimized
executable file
·67 lines (50 loc) · 1.78 KB
/
bt-optimized
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash -e
# Copyright (c) 2011-2018 TurnKey GNU/Linux - https://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-version
Wrapper script for all optimized builds
Arguments::
appname-version - e.g., core-14.2-jessie-amd64
Options::
--publish - if set, image and meta files will be published,
each local build will be removed after publishing
(unless BT_DEBUG set)
Environment::
BT_DEBUG - turn on debugging
EOF
exit 1
}
while [ "$1" != "" ]; do
case $1 in
--help|-h ) usage;;
--publish) opts="--publish"; clean="y";;
#--clean should ideally be it's own switch, but for now see above line
*) if [ -n "$appver" ]; then usage; else appver=$1; fi ;;
esac
shift
done
[ -n "$appver" ] || usage
[ -n "$BT_DEBUG" ] && unset clean
BT=$(dirname $(readlink -f $0))
ARCH=$(dpkg --print-architecture)
$BT/bt-vm $opts $appver
[ "$clean" = "y" ] && $BT/bin/clean vm $appver
$BT/bt-container $opts $appver
[ "$clean" = "y" ] && $BT/bin/clean container $appver
#$BT/bt-openstack $opts $appver
#[ "$clean" = "y" ] && $BT/bin/clean openstack $appver
#$BT/bt-xen $opts $appver
#[ "$clean" = "y" ] && $BT/bin/clean xen $appver
#[ "$ARCH" == "amd64" ] && $BT/bt-docker $opts $appver
exit 0