-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the start-dev-env aware of the test environment. If .env contain…
…s STEPUP_APP=test then it starts the requested dev containers in smoketest mode
- Loading branch information
Showing
9 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters