This repository was archived by the owner on Nov 21, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change 22
33APP_CONF=conf/sarjitsu.conf
44
5- source $APP_CONF
65
7- cleanup_containers (){
8- CLEAN_IDS=$( docker ps -a | grep -P ' ^.*(\ssarjitsu.*|' $METRICSTORE_CONTAINER_ID ' )$' | awk -F' ' ' {print $1}' )
9- if [[ ! -z $CLEAN_IDS ]]; then
10- echo " cleaning up previously created sarjitsu instances"
11- # docker stop $CLEAN_IDS
12- docker rm -f $CLEAN_IDS
13- fi
6+ log (){
7+ echo -e " [$( date +' %D %H:%M:%S %Z' ) ] - $* "
148}
159
16- cleanup_containers
10+ if [ ! -f $APP_CONF ]; then
11+ log " $APP_CONF doesn't exist. Taking additional steps to cleanup"
12+ log " PostgreSQL instance (if it's containerized), might still be running after this"
13+ CLEAN_IDS=$( docker ps -a | grep -e sarjitsu | awk -F' ' ' {print $1}' )
14+ else
15+ source $APP_CONF
16+ CLEAN_IDS=$( docker ps -a | grep -P ' ^.*(\ssarjitsu.*|' $METRICSTORE_CONTAINER_ID ' )$' | awk -F' ' ' {print $1}' )
17+ fi
1718
19+ if [[ ! -z $CLEAN_IDS ]]; then
20+ log " cleaning up previously created sarjitsu instances"
21+ # docker stop $CLEAN_IDS
22+ docker rm -f $CLEAN_IDS
23+ else
24+ log " nothing else to cleanup. check output of '$ docker ps -a' manually to verify"
25+ fi
You can’t perform that action at this time.
0 commit comments