Bootstrap scripts¶
The scripts are located in the rel/files/scripts/ directory in the MongooseIM repository.
By default the bootstrap command executes bootstrap01-hello.sh, which just prints the information below:
1 2 3 4 5 | |
Execution of scripts stops with an error, if any of scripts fail.
Environment variables, available from scripts:
ERTS_PATH- path to Erlang Runtime System, used by MongooseIM.MIM_DIR- MongooseIM release installation directory.
Templating bootstrap script¶
The script bootstrap20-template.escript renders files from the templates/ directory and writes
result files into the etc/ directory. If you need the result files in a separate directory,
create another script bootstrap30-template.sh, that moves files into a proper location.
The etc/templates.ini file contains default template variables.
A template config example:
1 2 3 | |
Only lowercase variables are allowed in templates.ini.
You can redeclare options using environment variables when executing the bootstrap script:
1 | |
Environment variables should have a MIM_ prefix. The variable names are case-insensitive
(but we suggest to use the uppercase variable names for consistency).
Demo template¶
A demo template is located in rel/files/templates/demo.config.
It is copied into the /templates directory inside your release directory.
Testing templating scripts¶
Templating script source code: rel/files/scripts/bootstrap20-template.escript.
Testing script code:
1 2 | |
Testing command:
1 | |