forked from SAP-samples/btp-setup-automator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·38 lines (24 loc) · 1.46 KB
/
run
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
#!/usr/bin/env bash
NOCOLOR='\033[0m'
GREEN='\033[0;32m'
thisname="btp-setup-automator"
echo -e "${GREEN}Cleaning up containers and images (if existing)${NOCOLOR}"
docker container stop "${thisname}"
docker container rm -f "${thisname}"
docker image rm -f "${thisname}"
if [ "$1" == "RunReleaseFromRegistry" ]; then
echo -e "${GREEN}Pulling container image RELEASE from registry ...${NOCOLOR}"
docker pull ghcr.io/sap-samples/btp-setup-automator:latest
echo -e "${GREEN}Starting the container as '${thisname}' - Access possible e.g. via VS Code${NOCOLOR}"
docker container run --rm -it -d --name "${thisname}" ghcr.io/sap-samples/btp-setup-automator:latest
elif [ "$1" == "RunDevFromRegistry" ]; then
echo -e "${GREEN}Pulling container image DEV from registry ...${NOCOLOR}"
docker pull ghcr.io/sap-samples/btp-setup-automator-dev:dev
echo -e "${GREEN}Starting the container as '${thisname}' - Access possible e.g. via VS Code${NOCOLOR}"
docker container run --rm -it -d --name "${thisname}" ghcr.io/sap-samples/btp-setup-automator-dev:dev
else
echo -e "${GREEN}Building the container image ...${NOCOLOR}"
docker image build -t ${thisname}:latest -f "config/Dockerfile" .
echo -e "${GREEN}Starting the container as '${thisname}' - Access possible e.g. via VS Code${NOCOLOR}"
docker container run -e BTPSA_VERSION_GIT="$(git describe --long --tags --always)" --rm -it -d --name "${thisname}" "${thisname}"
fi