devcontainers / devcontainers/ci
Allow for array specification for elements accepting multiple values.
- Dominant language
- TypeScript
- Stars
- 496
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
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:
```yaml
- 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:
```yaml
- 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.
Contributor guide
Assessment
This issue has not been assessed yet.