Skip to content

Commit

Permalink
allow running run-ab-platform.sh in detached mode (#26583)
Browse files Browse the repository at this point in the history
* allow running in detached mode

* conditionally call docker compose down

---------

Co-authored-by: josephkmh <joseph@airbyte.io>
  • Loading branch information
cpdeethree and josephkmh committed May 31, 2023
1 parent c094df4 commit 7ce51a2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions run-ab-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Help()
echo -e " -r --refresh ${red_text}DELETE${default_text} existing assets and re-download new ones"
echo -e " -h --help Print this Help."
echo -e " -x --debug Verbose mode."
echo -e " -b --background Run docker compose up in detached mode."
echo -e ""
}

Expand Down Expand Up @@ -82,6 +83,7 @@ DeleteLocalAssets()
done
}

dockerDetachedMode=""

# $0 is the currently running program (this file)
this_file_directory=$(dirname $0)
Expand All @@ -106,6 +108,9 @@ for argument in $@; do
-x | --debug)
set -o xtrace # -x display every line before execution; enables PS4
;;
-b | --background)
dockerDetachedMode="-d"
;;
*)
echo "$argument is not a known command."
echo
Expand Down Expand Up @@ -155,7 +160,7 @@ done
echo
echo -e "$blue_text""Starting Docker Compose""$default_text"

docker compose up
docker compose up $dockerDetachedMode

# $? is the exit code of the last command. So here: docker compose up
if test $? -ne 0; then
Expand All @@ -164,6 +169,8 @@ if test $? -ne 0; then
fi

########## Ending Docker ##########
docker compose down

echo -e "$blue_text""Stopping Docker Compose""$default_text"
if [ -z "$dockerDetachedMode" ]; then
docker compose down
else
echo -e "$blue_text""Airbyte containers are running!""$default_text"
fi

0 comments on commit 7ce51a2

Please sign in to comment.