Pass expanded WSR_ job variables to workers
🎫 Addresses issue: #174 (closed)
Fixes #174 (closed)
🛠️ Summary of changes
- New Config step
- Creates a
config.shscript and registers it with env var inmain.tf. - The config step runs before all others and is meant to perform setup and then output a set of variables that will be made available to later runner steps (not the pipeline itself).
- Config overlaps in purpose with a lot of what was in
base.shso I relocated most of that into config.
- Creates a
- Creates a temporary file to store interpolated environment variables and reload them across runner steps.
- File created in
config.shalong with global variable for reference -
prepare.shsaves expanded variables to the file -
run.shloads the variables and replaces them in scripts before passing to worker -
cleanup.shdeletes the file
- File created in
- Expands previous
WSR_parsing to include vars used in the braced ("I am ${WSR_xyz} bracing") style.
👀 Screenshots and Evidence
I worked with the GitLab CI POC app to make a small test case which can be see here: https://workshop.cloud.gov/devtools-staging/poc/gitlab-ci-poc/-/merge_requests/30. Its latest CI run, at time of writing, was passing and can be seen outputting correctly interpolated values at the end of the job.