You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very helpful if resource-specific metadata, such as the stack name, were available as interpolatable variables during pre and post deployment shell commands.
Example Use Case
Say I want to create a stack-specific directory in a shared mount. This is useful when we try to persist data for multiple stacks that share the exact same repo.
For instance, if I am deploying three traefik stacks on different servers, and want to persist say the acme.json files on a central location, being able to reference the stack name helps avoid conflicts by letting each stack write to its own folder.
Current Workaround
One workaround is to use the current working directory as a stand-in for the stack name:
STACK_NAME=$(basename "$PWD")
This can work, but it falls short when the same linked repo is used to deploy multiple identical stacks on the same server. In that case, $PWD is the same for all of them (repo cloned dir), and we can’t tell the stacks apart.
Suggestion
It would help to have the stack name (and possibly other metadata) available as environment variables during hook execution. This would make it much easier to write reliable, stack-aware logic in shell scripts.
⸻
Let me know if you want to include other metadata ideas besides the stack name.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be very helpful if resource-specific metadata, such as the stack name, were available as interpolatable variables during pre and post deployment shell commands.
Example Use Case
Say I want to create a stack-specific directory in a shared mount. This is useful when we try to persist data for multiple stacks that share the exact same repo.
For example:
For instance, if I am deploying three traefik stacks on different servers, and want to persist say the acme.json files on a central location, being able to reference the stack name helps avoid conflicts by letting each stack write to its own folder.
Current Workaround
One workaround is to use the current working directory as a stand-in for the stack name:
This can work, but it falls short when the same linked repo is used to deploy multiple identical stacks on the same server. In that case, $PWD is the same for all of them (repo cloned dir), and we can’t tell the stacks apart.
Suggestion
It would help to have the stack name (and possibly other metadata) available as environment variables during hook execution. This would make it much easier to write reliable, stack-aware logic in shell scripts.
⸻
Let me know if you want to include other metadata ideas besides the stack name.
Beta Was this translation helpful? Give feedback.
All reactions