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

Support storing variable via yaml file #366

Closed
marcinkuzminski opened this issue Mar 30, 2023 · 4 comments
Closed

Support storing variable via yaml file #366

marcinkuzminski opened this issue Mar 30, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@marcinkuzminski
Copy link

Description

Here's our use case, we keep certain versions inside the source code of bashly generated script. This is mostly used when we do a self-update call that does downloads new script, and does comparison on internal changes and components our script is installing.

Similar how version works and it's available globally in the script.

Our workaround is to keep thi in the initialize.sh, but it would be nicer if we bump version and all internal versions of components from yaml file.

my idea was a new section called variables that would keep them in it's own namespace so it doesn't get mixed with any other script defined vars.

variables:
 - foo: bar

What do you think about such feature ?

@marcinkuzminski marcinkuzminski added the enhancement New feature or request label Mar 30, 2023
@DannyBen
Copy link
Owner

DannyBen commented Mar 30, 2023

I am not sure I am following.
Are you talking about internal variables that your script needs?

If so, what is wrong with having this setup:

# src/initialize.sh
load_vars

# src/lib/load_vars.sh
load_vars() {
  git_version=1.2.3
  docker_version=4.5.6
}

Isn't this clean enough?
How would you imagine this variables section in the YAML affect the generated script?

@DannyBen
Copy link
Owner

DannyBen commented Mar 30, 2023

BTW - since you mentioned internal components, I am not sure if you are familiar with the Extensible Scripts feature in bashly, which lets you develop standalone scripts that work together (like developing a separate script for "docker pull" and "docker build").

Just wanted to mention it in case it is relevant.

@DannyBen
Copy link
Owner

DannyBen commented Apr 7, 2023

@marcinkuzminski do you still need help with this / wish to discuss this further?

@DannyBen
Copy link
Owner

I am closing this. If there is any interest in continuing the discussion, we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants