Script to build and start all containers.

This commit is contained in:
Stephane Gourichon
2024-03-24 23:28:29 +01:00
committed by Stephane Gourichon
parent f3d82afd43
commit 72567360a4

View File

@@ -0,0 +1,29 @@
#!/bin/bash
cd -P "$(dirname "$(readlink -f "$0")" )"
cd ..
INFRA_ROOT="$PWD"
RC=0
function fail_one()
{
echo >&2 "FAILURE on: " "$@"
RC=$(( RC + 1 ))
}
while IFS="" read -u 3 -r SERVICE_PATH
do
pushd "${SERVICE_PATH%/*}"
pwd
docker-compose pull || { fail_one "pull" ; continue ; }
docker-compose build --no-cache || { fail_one "build" ; continue ; }
docker-compose up -d || { fail_one "switch to newly built container" ; continue ; }
popd
done 3< <( find . -iname "compose.yaml" )
echo "Overall result: $RC"
exit "$RC"