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

for is working for cmds but not for deps #1549

Closed
leobenkel opened this issue Mar 12, 2024 · 2 comments
Closed

for is working for cmds but not for deps #1549

leobenkel opened this issue Mar 12, 2024 · 2 comments
Labels
type: question Further information is requested.

Comments

@leobenkel
Copy link

  • Task version:
task --version
Task version: v3.35.1 (h1:zjQ3tLv+LIStDDTzOQx8F97NE/8FSTanjZuwgy/hwro=)
  • Operating system:
uname -a
Linux xxx 6.5.0-25-generic #25~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 20 16:09:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

so when i do:

  build_module:
    requires:
      vars:
      - MODULE_NAME
      - ROOT_DIR
    vars:
      MODULE_NAME: '{{ .MODULE_NAME | default "" }}'
    preconditions:
      - sh: test -f {{.ROOT_DIR}}/modules/{{.MODULE_NAME}}/build.sh
    cmds:
      - echo "Building the {{.MODULE_NAME}} image"
      - echo "cd {{.ROOT_DIR}}/modules/{{.MODULE_NAME}}"

  build_all:
    vars:
      MODULES: a b c
    cmds:
      - for: [a, b, c]
        task: build_module
        vars:
          MODULE_NAME: '{{.ITEM}}'

it works

but if you replace cmds by deps it does not work anymore.

and i have tried with for: {var: MODULES} and it behave the same as well: works with cmds but not with deps

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Mar 12, 2024
@pd93
Copy link
Member

pd93 commented Mar 12, 2024

Hi @leobenkel. Unfortunately, our docs are not currently versioned so this has been added to the site before it has been released. The looping over deps functionality was only merged to main a few days ago (#1541) and will be released in the next version of Task.

Also in the next release, we will be changing how we version our docs so that this kind of confusion doesn't keep happening.

@pd93 pd93 closed this as completed Mar 12, 2024
@pd93 pd93 added type: question Further information is requested. and removed state: needs triage Waiting to be triaged by a maintainer. labels Mar 12, 2024
@leobenkel
Copy link
Author

ah ok, thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Further information is requested.
Projects
None yet
Development

No branches or pull requests

3 participants