-
Notifications
You must be signed in to change notification settings - Fork 2
/
bld
executable file
·71 lines (64 loc) · 1.4 KB
/
bld
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
68
69
70
71
#!/bin/bash
#
# This is now obsolete. You should use the Makefile instead. Once our
# ci jobs are updated, this script will be deleted.
#
set -e
function usage() {
echo 1>&2 "Usage: $0 [-d] [-x] [-i image] [-s additional] TAG"
echo 1>&2 " -d enables dry run (no Docker build or push)"
echo 1>&2 " -x is 'do not push' (but does build)."
echo 1>&2 " -i image specifies target image location."
echo 1>&2 " -s additional adds '_additional' to end of exp. build tag."
echo 1>&2 " default image='docker.io/lsstsqre/sciplat-lab'"
echo 1>&2 " typical TAG='w_2021_03'"
exit 2
}
function cleanup {
if [ -n "${WORKDIR}" ]; then
rm -rf ${WORKDIR}
fi
}
trap cleanup EXIT
WORKDIR=""
OPTIND=1
DRY_RUN=0
SUPPLEMENTARY=0
NOPUSH=0
IMAGE="docker.io/lsstsqre/sciplat-lab"
TARGET="all"
while getopts ':hvdxi:s:efpt:n:b:' opt; do
case $opt in
h)
usage
;;
d)
TARGET="dockerfile"
;;
x)
TARGET="image"
;;
i)
IMAGE=${OPTARG}
;;
s)
SUPPLEMENTARY=${OPTARG}
;;
e | f | p| t | n | b | v)
echo "Obsolete option ${opt} no longer has any effect."
;;
\?)
usage
;;
esac
done
shift $((OPTIND - 1))
TAG=${1}
if [ -z "${TAG}" ] || [ $# -gt 1 ]; then
usage
fi
suparg=""
if [ -n "${SUPPLEMENTARY}" ]; then
suparg="supplementary=${SUPPLEMENTARY}"
fi
make tag=${TAG} image=${IMAGE} ${suparg} ${TARGET}