Skip to content

Commit f0fc0fb

Browse files
author
Kevin Paulisse
committed
Add documentation on bootstrap environment variables
1 parent a067711 commit f0fc0fb

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

doc/advanced-bootstrap.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,28 @@ The [example configuration file](/examples/octocatalog-diff.cfg.rb) contains an
3131
# settings[:bootstrap_script] = '/etc/puppetlabs/repo-bootstrap.sh' # Absolute path
3232
# settings[:bootstrap_script] = 'script/bootstrap' # Relative path
3333
```
34+
35+
## Bootstrap environment
36+
37+
When the bootstrap script runs, a limited set of environment variables are passed from the shell running octocatalog-diff. Only these variables are set:
38+
39+
- `HOME`
40+
- `PATH`
41+
- `PWD` (set to the base directory of your Puppet checkout)
42+
- `BASEDIR` (as explicitly set with `--basedir` CLI option or `settings[:basedir]` setting)
43+
44+
If you wish to set additional environment variables for your bootstrap script, you may do so via the `--bootstrap-environment VAR=value` command line flag, or by defining `settings[:bootstrap_environment] = { 'VAR' => 'value' }` in your configuration file.
45+
46+
As an example, consider that your bootstrap script is written in Python, and needs the `PYTHONPATH` variable set to `/usr/local/lib/python-custom`. Even if this environment variable is set when octocatalog-diff is run, it will not be available to the bootstrap script. You may supply it via the command line:
47+
48+
```
49+
octocatalog-diff --bootstrap-environment PYTHONPATH=/usr/local/lib/python-custom ...
50+
```
51+
52+
Or you may specify it in your configuration file:
53+
54+
```
55+
settings[:bootstrap_environment] = {
56+
'PYTHONPATH' => '/usr/local/lib/python-custom'
57+
}
58+
```

0 commit comments

Comments
 (0)