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

Allow for array specification for elements accepting multiple values. #248

Open
Clockwork-Muse opened this issue Jun 20, 2023 · 1 comment

Comments

@Clockwork-Muse
Copy link

Azure DevOps pipeline definitions (and potentially GitHub Actions as well, but I haven't done much with them) allows for inputs to tasks and template parameters to be arrays.

Where possible, please consider switching to using this functionality, instead of whatever other style is used currently. It would mean the definition could look like this:

- task: DevcontainersCi@0
  inputs:
    imageName: $(RegistryImage)
    # Currently imageTag is a comma separated list
    imageTag:
      - $(VersionTag)
      - ${{ if parameters.pushLatest }}:
        - latest
    push: filter
    sourceBranchFilterForPush: refs/heads/main
    # Currently cacheFrom requires a multi-line definition
    cacheFrom:
      - $(RegistryImage):latest
      - $(RegistryImage):$(VersionTag)
    noCache: ${{ parameters.noCache }}

... instead of:

- task: DevcontainersCi@0
  inputs:
    imageName: $(RegistryImage)
    ${{ if parameters.pushLatest }}:
      imageTag: $(VersionTag),latest
    ${{ else }}:
      imageTag: $(VersionTag)
    push: filter
    sourceBranchFilterForPush: refs/heads/main
    # To get multiple items
    cacheFrom: |
      $(RegistryImage):latest
      $(RegistryImage):$(VersionTag)
    noCache: ${{ parameters.noCache }}

As an aside, there appears to be **no** documentation around how to pass multiple elements to `cacheFrom`. It doesn't complain if you pass a comma-separated list (somehow), but it only generates a single `--cache-from` argument, instead of a separate one for each image.
@bamurtaugh
Copy link
Member

Thank you for filing @Clockwork-Muse. cc @stuartleeks for thoughts

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

No branches or pull requests

2 participants