-
Notifications
You must be signed in to change notification settings - Fork 443
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
Custom bash script to run before default start script #380
Comments
As an example, I want to dynamically set the java memory setting based on the size of the box:
and I need the hostname in an environment variable:
|
This seems to do something like what you want: bashScriptExtraDefines ++= Seq(
"""export HOSTNAME=`hostname --fqdn`""",
"""TOTAL_MEM=`free -m | sed -n -e '/^Mem:/s/^[^0-9]*\([0-9]*\) .*/\1/p'`""",
"""JAVA_MEM=`expr $TOTAL_MEM / 5 \* 4`""",
"""app_mem=${JAVA_MEM}"""
) or perhaps bashScriptExtraDefines ++= IO.readLines(baseDirectory.value / "scripts" / "extra.sh") The lines are placed near the end of the script, and have access to a number of utility bash functions (e.g. Here's an example where the feature is used to add a |
Perfect, bashScriptExtraDefines is what I was looking for. I'll beef up the documentation on this in my MR #379. |
I'd like a way to run a custom bash script (which sources a file for environment variables and sets up some other settings) without having to override the default templates. I like the idea of the
/etc/default
server setting and .conf files, but these seem to concatenate settings--one per line--to the command line options of the start script. I'd like a place to add a little more complexity without having to mimic the default script template.Suggestions? I thought there was a way to add a setting to call an external script (or other command) before the start script. Maybe there's a template parameter key I'm missing?
Thanks,
Mike
The text was updated successfully, but these errors were encountered: