Skip to content
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

Explicit env vars for constructing paths in scripts and spruce templates #259

Open
gberche-orange opened this issue May 17, 2019 · 0 comments

Comments

@gberche-orange
Copy link
Member

Is your feature request related to a problem? Please describe.

As a template authors, in order to have scripts and spruce expressions to fetch files (in config repo ot template repos), that avoid hardcoded path (such as root deploment, subdeployment), I need to rely on variables.

This enables:

Describe the solution you'd like

Export new env variables such as:

SECRET_HOME=
TEMPLATE_HOME=
ROOT_DEPLOYMENT=hello-world-root-depls
DEPLOYMENT=generic-app

that would be used using spruce env var interpolation https://github.com/geofffranks/spruce/blob/master/doc/environment-variables-and-defaults.md#can-i-use-the-values-of-environment-variables-in-an-operation

path_to_my_file: ((concat $TEMPLATE_HOME "/" $ROOT_DEPLOYMENT "/cf-apps-deployments/"  $DEPLOYMENT "/template" ))

and in shell script in

${TEMPLATE_HOME}/{ROOT_DEPLOYMENT}/cf-apps-deployments/${DEPLOYMENT}/template
${SECRET_HOME}/{ROOT_DEPLOYMENT}/cf-apps-deployments/${DEPLOYMENT}/myfile.txt

Describe alternatives you've considered

secrets: # this key is pruned by spruce
timeout_from_file: ((concat "../../../../" $CUSTOM_SCRIPT_DIR "/spruce-file-sample-from-templates.txt" ))

Additional context

This is a followup of #255 and #258 (comment)

@gberche-orange gberche-orange changed the title Explicit env vars for constructing paths in scripts and spruce Explicit env vars for constructing paths in scripts and spruce templates May 17, 2019
@o-orand o-orand moved this to P3 in CF OPS Automation Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants