Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(BUX-000): Adds flag for image rebuilding purposes to quickstart script #398

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ There are two way of running this script:
-b, --background Whether the bux-server should be run in background - true/false
-x, --xpub Define admin xPub
-l, --load Load .env.config file and run bux-server with its settings
-rb --rebuild Rebuild docker images before running
```

```bash
Expand Down
22 changes: 18 additions & 4 deletions start-bux-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ while [[ $# -gt 0 ]]; do
load_config="true"
shift
;;
-rb|--rebuild)
rebuild="true"
load_config="true"
;;
-h|--help)
echo -e "\033[1mUsage: ./start-bux-server.sh [OPTIONS]$reset"
echo ""
Expand All @@ -96,6 +100,7 @@ while [[ $# -gt 0 ]]; do
echo -e " -b, --background\t Whether the bux-server should be run in background - true/false$reset"
echo -e " -x, --xpub\t\t Define admin xPub$reset"
echo -e " -l, --load\t\t Load .env.config file and run bux-server with its settings$reset"
echo -e " -rb, --rebuild\t Rebuild docker images before running$reset"
exit 1;
shift
;;
Expand Down Expand Up @@ -218,6 +223,15 @@ if [ "$bux_server" == "true" ]; then
fi
fi

if [ "$rebuild" == "" ]; then
ask_for_yes_or_no "\033[1mDo you want to rebuild docker images before running?$reset"
rebuild=$choice
fi

if [ "$rebuild" == "true" ]; then
docker_command_attributes="--build"
fi

if [ "$background" == "" ]; then
ask_for_yes_or_no "\033[1mDo you want to run Bux-server in background?$reset"
background=$choice
Expand All @@ -233,11 +247,11 @@ if [ "$bux_server" == "true" ]; then

echo -e "\033[0;32mRunning Bux-server...$reset"
if [ "$background" == "true" ]; then
echo -e "\033[0;37mdocker compose up -d bux-server$reset"
docker_compose_up "-d bux-server"
echo -e "\033[0;37mdocker compose up $docker_command_attributes -d bux-server$reset"
docker_compose_up "$docker_command_attributes -d bux-server"
else
echo -e "\033[0;37mdocker compose up bux-server$reset"
docker_compose_up "bux-server"
echo -e "\033[0;37mdocker compose up $docker_command_attributes bux-server$reset"
docker_compose_up "$docker_command_attributes bux-server"

function cleanup {
echo -e "\033[0;31mStopping additional services...$reset"
Expand Down
Loading