-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
44 lines (36 loc) · 1.1 KB
/
build.sh
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
#!/bin/bash
echo
echo "+================================"
echo "| START: FaasSubMgr"
echo "+================================"
echo
source backend/.env
datehash=`date | md5sum | cut -d" " -f1`
abbrvhash=${datehash: -8}
echo "Using conn string ${SPECUIMDBCONNSTR}"
echo "Using conn string ${MASTERENCKEYASBASE64}"
echo
echo "Building container using tag ${abbrvhash}"
echo
docker build -t graboskyc/faassubmgr:latest -t graboskyc/faassubmgr:${abbrvhash} --platform=linux/amd64 .
EXITCODE=$?
if [ $EXITCODE -eq 0 ]
then
echo
echo "Starting container"
echo
docker stop faassubmgr
docker rm faassubmgr
docker run -t -i -d -p 8000:8000 --name faassubmgr -e "SPECUIMDBCONNSTR=${SPECUIMDBCONNSTR}" -e "MASTERENCKEYASBASE64=${MASTERENCKEYASBASE64}" --restart unless-stopped graboskyc/faassubmgr:${abbrvhash}
echo
echo "+================================"
echo "| END: FaasSubMgr"
echo "+================================"
echo
else
echo
echo "+================================"
echo "| ERROR: Build failed"
echo "+================================"
echo
fi