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

Added ability for custom startup script #55

Merged
merged 8 commits into from
Jun 28, 2018
6 changes: 6 additions & 0 deletions 5.6/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ else
# $@ does not work here. $* has to be used.
exec gosu docker bash -c "$DOCKSALRC; exec $*"
fi

if [[ -x ${PROJECT_ROOT}/.docksal/services/cli/startup.sh ]]; then
echo-debug "Running Custom Startup Script..."
${PROJECT_ROOT}/.docksal/services/cli/startup.sh
echo-debug "Custom Startup Script Complete..."
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplication

6 changes: 6 additions & 0 deletions 7.0/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ else
# $@ does not work here. $* has to be used.
exec gosu docker bash -c "$DOCKSALRC; exec $*"
fi

if [[ -x ${PROJECT_ROOT}/.docksal/services/cli/startup.sh ]]; then
echo-debug "Running Custom Startup Script..."
${PROJECT_ROOT}/.docksal/services/cli/startup.sh
echo-debug "Custom Startup Script Complete..."
fi
6 changes: 6 additions & 0 deletions 7.1/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ else
# $@ does not work here. $* has to be used.
exec gosu docker bash -c "$DOCKSALRC; exec $*"
fi

if [[ -x ${PROJECT_ROOT}/.docksal/services/cli/startup.sh ]]; then
echo-debug "Running Custom Startup Script..."
${PROJECT_ROOT}/.docksal/services/cli/startup.sh
echo-debug "Custom Startup Script Complete..."
fi
6 changes: 6 additions & 0 deletions 7.2/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ else
# $@ does not work here. $* has to be used.
exec gosu docker bash -c "$DOCKSALRC; exec $*"
fi

if [[ -x ${PROJECT_ROOT}/.docksal/services/cli/startup.sh ]]; then
echo-debug "Running Custom Startup Script..."
${PROJECT_ROOT}/.docksal/services/cli/startup.sh
echo-debug "Custom Startup Script Complete..."
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add newline

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ cli

See [docs](https://docs.docksal.io/en/master/tools/xdebug) on using Xdebug for web and cli PHP debugging.

## Customizing Startup

To run a custom startup script anytime the `cli` container has started create a `startup.sh` file within the
`.docksal/services/cli` directory. Additionally, make sure that the file is executable as well so that the container
does not run into issues when attempting to execute the file.

## Secrets and integrations

Expand Down