-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-install
executable file
·27 lines (20 loc) · 990 Bytes
/
run-install
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
#!/usr/bin/env bash
set -eu
SCRIPTPATH="$(cd "$(dirname "$BASH_SOURCE")" && pwd)"
export SERVICENAME=$(cat "$SCRIPTPATH/../servicename" | tr '[:upper:]' '[:lower:]')
# Build/update service if necessary
if [ -d "$SCRIPTPATH/../build_output" ]; then
# update scripts, but not actual build results
cp "$SCRIPTPATH"/../*.sh "$SCRIPTPATH/../servicename" "$SCRIPTPATH/ci/buildscripts/publish-network-infos.sh" "$SCRIPTPATH/../build_output/"
echo "[.] Service is already built"
else
echo "[.] Need to build service"
"$SCRIPTPATH/run-build"
fi
# This must be a file otherwise docker-compose will produce "funny" results
touch "$SCRIPTPATH/../docker-container-infos.txt"
# Install a docker container
cd "$SCRIPTPATH/.."
docker build -t "saarsec/$SERVICENAME" -f "$SCRIPTPATH/ci/InstallLocal.Dockerfile" .
echo "[*] Created docker image \"saarsec/$SERVICENAME:latest\" - use \"docker-compose up\" to run."
echo " After startup you can find its IP in ./docker-container-infos.txt"