Skip to content

Commit

Permalink
Make the start-dev-env aware of the test environment. If .env contain…
Browse files Browse the repository at this point in the history
…s STEPUP_APP=test then it starts the requested dev containers in smoketest mode
  • Loading branch information
quartje committed Jan 17, 2024
1 parent c95ae92 commit 2f09d61
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion stepup/azuremfa/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${AZUREMFA_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
2 changes: 1 addition & 1 deletion stepup/demogssp/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${DEMOGSSP_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
2 changes: 1 addition & 1 deletion stepup/gateway/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${GATEWAY_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
2 changes: 1 addition & 1 deletion stepup/middleware/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${MIDDLEWARE_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
2 changes: 1 addition & 1 deletion stepup/ra/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${RA_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
2 changes: 1 addition & 1 deletion stepup/selfservice/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${SELFSERVICE_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
26 changes: 17 additions & 9 deletions stepup/start-dev-env.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#!/usr/bin/env bash
# source .env so that we know when to start in test mode
source .env
if [ "${STEPUP_VERSION}" == "test" ]; then
extra_compose_args="-f docker-compose-behat.yml"
echo "starting in test mode"
else
extra_compose_args=""
fi

# Read the apps and their code paths from the arguments passed to the script
docker_compose_arg=()
docker_compose_args=()
for arg in "$@"; do
app=$(echo $arg | cut -d ':' -f 1)
path=$(echo $arg | cut -d ':' -f 2)
echo "export ${app^^}_CODE_PATH=${path}" >> .start-dev-env-vars
docker_compose_args+=("-f ./${app}/docker-compose.override.yml")
app=$(echo $arg | cut -d ':' -f 1)
path=$(echo $arg | cut -d ':' -f 2)
echo "export ${app^^}_CODE_PATH=${path}" >>.start-dev-env-vars
docker_compose_args+=("-f ./${app}/docker-compose.override.yml")
done

# Read the generated env file with the apps and their code paths
source .start-dev-env-vars ; rm .start-dev-env-vars

source .start-dev-env-vars
rm .start-dev-env-vars
# Use docker compose to start the environment but with the modified override file(s)
echo -e "Starting the dev environment with the following command:\n"
echo -e "docker compose -f docker-compose.yml ${docker_compose_args[@]} up "${@:3}"\n"
docker compose -f docker-compose.yml ${docker_compose_args[@]} up "${@:3}"
echo -e "docker compose -f docker-compose.yml "${docker_compose_args[@]}" "${extra_compose_args}" up "${@:3}"\n"
docker compose -f docker-compose.yml ${docker_compose_args[@]} ${extra_compose_args} up "${@:3}"
2 changes: 1 addition & 1 deletion stepup/tiqr/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${TIQR_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true
2 changes: 1 addition & 1 deletion stepup/webauthn/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
volumes:
- ${WEBAUTHN_CODE_PATH}:/var/www/html
environment:
- APP_ENV=dev
- APP_ENV=${APP_ENV:-dev}
- APP_DEBUG=true

0 comments on commit 2f09d61

Please sign in to comment.