Skip to content

Commit

Permalink
Log docker command
Browse files Browse the repository at this point in the history
  • Loading branch information
mesudip committed Aug 17, 2024
1 parent 68c6dea commit f84bd48
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/test-infrastructure/build-and-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
17 changes: 13 additions & 4 deletions tests/test-infrastructure/build-images.sh
Original file line number Diff line number Diff line change
@@ -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
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

0 comments on commit f84bd48

Please sign in to comment.