From 1cc11fba83b0b1b817eb52fa8e2af64a40b0ed2e Mon Sep 17 00:00:00 2001 From: michirod Date: Thu, 1 Jul 2021 08:28:22 +0200 Subject: [PATCH] Add ignore and pre_start --- update-containers.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/update-containers.sh b/update-containers.sh index fe05658..03c9d45 100755 --- a/update-containers.sh +++ b/update-containers.sh @@ -3,6 +3,7 @@ exec_update() { docker-compose build --pull docker-compose pull + [[ -e ".pre_start" ]] && bash .pre_start docker-compose up -d } @@ -11,14 +12,22 @@ exec_stop() { } exec_start() { + [[ -e ".pre_start" ]] && bash .pre_start docker-compose up -d } is_service() { [[ "$(ls $1/docker-compose.yml)" ]] } +is_ignored() { + [[ -e "$1/.ignore" ]] +} get_all_services() { - echo $(find . -maxdepth 2 -name docker-compose.yml | while read line; do echo $(dirname $line | sed 's:^./::'); done) + all=$(find . -maxdepth 2 -name docker-compose.yml | while read line; do echo $(dirname $line | sed 's:^./::'); done) + for dir in $all; do + is_ignored $dir || output+="$dir " + done + echo $output } #set default function