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 of variables and foreach #63

Open
Hobart2967 opened this issue Jan 22, 2020 · 1 comment
Open

Support of variables and foreach #63

Hobart2967 opened this issue Jan 22, 2020 · 1 comment

Comments

@Hobart2967
Copy link

Hobart2967 commented Jan 22, 2020

Is your feature request related to a problem? Please describe.
Id like to see an option to set variables like real option values as shared variable.

Example:

vars:
  enabled-environments: &enabled-environments
    - dev
    - prod
    - all

tasks:
  build:
    options:
      environment:
        values: *enabled-environments
    run:
      - when: 
            equal: { environment: 'all' }
         task: build-all
      - when:
          not-equal: { environment: 'all' }
        run:
           yarn build:${environment}
  build-all:
    run:
      - foreach:
           list: ${vars.enabled-environments}
           as: current-environment
           task: # or run:
              name: build
              options:
                 environment: ${current-environment}

Describe the solution you'd like
This makes it easier to build a cli with an include all or specific option.

@rliebz
Copy link
Owner

rliebz commented Jan 23, 2020

Thanks for opening an issue!

I see this is as related to https://github.com/rliebz/tusk/issues/26—a proper array type should eventually support both the "for each" construct, to let users call something once per item, and serialization, to let users input values as arrays into Tusk while passing them along to other programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants