Closed maxpavlov closed 1 year ago
As far as I know, it doesn't matter if you put any environment variables in the config file.
You can already see it working well elsewhere.
For example, you can view the FIRST_USER_NAME variable in "build.sh".
This variable is specified only for build.sh, but is used in the file "stage2/01sys-tweaks/01-run.sh".
Variables must be "export" from "build.sh."
Thank you @bdh1993 for the comment. Yes, putting a variable in a config file and 'export'ing it from a build.sh would propagate it's availability to the "sub-scripts". However I wonder what is the proper way to add the environment variable into a pipeline so that it's available in "sub-scripts", without a need to export it from the root script.
I haven't tried it, but I don't see why an export wouldn't work from the config file. IIRC, it gets sourced by the main build script, so it should be the same.
Yes, export works. So to get it to work you add a variable to config and 'export' it from the build.sh. Minimum of two actions to make a custom env var available to stage scripts.
It works well, I'll close this one. Thanks.
How would you need to modify the build-docker.sh
in order to accomplish this? I want to access a custom variable in a XX-run-chroot.sh
script
Can I add my own environment variable to
config
and expect it to be available for all the .sh scripts that execute during a build? Something likeThanks.