-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·47 lines (38 loc) · 1.13 KB
/
build.sh
File metadata and controls
executable file
·47 lines (38 loc) · 1.13 KB
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
#!/usr/bin/env bash
set -eu
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )"
. "$HERE/version.sh"
# The only allowed arguments are the optional version string (no flag) and the
# flag to just print the Docker image names.
# Note that because VERSION is exported in version.sh, its value will be propagated
# to the subsequent build.sh script invocations.
print_docker_image_names=false
while [[ $# -gt 0 ]]
do
case $1 in
-h|--h*)
echo "usage: $0 [-h|--help] [--print-docker-image] [VERSION]"
exit 0
;;
--print-docker-image*)
print_docker_image_names=true
;;
-*)
echo "ERROR: $0: Unrecognized argument $1"
exit 1
;;
*)
VERSION=$1
;;
esac
shift
done
cd "$HERE"
if $print_docker_image_names
then
sbt -no-colors "set version in ThisBuild := \"$VERSION\"" "show docker::imageNames" | grep -e 'lightbend/[^)]*' --only-matching
exit $?
fi
echo "$0: Using version $VERSION"
sbt -no-colors "set version in ThisBuild := \"$VERSION\"" "show version" clean package dockerBuildAndPush
echo "$PWD: built package and docker image(s). Pushed the docker image(s)."