diff --git a/tests/test-infrastructure/build-and-deploy.sh b/tests/test-infrastructure/build-and-deploy.sh index 4c6e6e166..2244cb73a 100755 --- a/tests/test-infrastructure/build-and-deploy.sh +++ b/tests/test-infrastructure/build-and-deploy.sh @@ -16,6 +16,7 @@ check_env # Build images ./build-images.sh function update-service(){ + echo '> docker' service update --image "$2" "$1" docker service update --image "$2" "$1" } diff --git a/tests/test-infrastructure/build-images.sh b/tests/test-infrastructure/build-images.sh index e86103e7a..94f039e72 100755 --- a/tests/test-infrastructure/build-images.sh +++ b/tests/test-infrastructure/build-images.sh @@ -1,15 +1,24 @@ #!/usr/bin/env bash set -e + +# Define a function to log and execute Docker commands +docker_() { + local cmd="$*" + echo docker "$cmd" + docker $cmd +} + export BASE_IMAGE_NAME="govtool" + BASE_IMAGE_EXISTS=$(docker images -q "$BASE_IMAGE_NAME"/backend-base) if [ -z "$BASE_IMAGE_EXISTS" ]; then echo "Building the base image..." - docker build -t "$BASE_IMAGE_NAME"/backend-base -f ../../govtool/backend/Dockerfile.base ../../govtool/backend + docker_ build -t "$BASE_IMAGE_NAME"/backend-base -f ../../govtool/backend/Dockerfile.base ../../govtool/backend else echo "Base image already exists. Skipping build." fi -docker compose -f ./docker-compose-govtool.yml build -docker compose -f ./docker-compose-govaction-loader.yml build -docker compose -f ./docker-compose-test.yml build \ No newline at end of file +docker_ compose -f ./docker-compose-govtool.yml build +docker_ compose -f ./docker-compose-govaction-loader.yml build +docker_ compose -f ./docker-compose-test.yml build