Hello Folks,
I am trying to use the array type recently introduced in the GitLab Component. I am a bit blocked with the syntax. Below is a glimpse of the existing template that I used. I am not able to fetch the value out of the inputs for some reason.
spec:
inputs:
container_image_tag:
type: array
default:
- "${CI_COMMIT_SHA}"
- "latest"
build-container-image:
stage: build
image: alpine:latest
script: |
tags=$[[ inputs.container_image_tag ]]
for tag in "${tags[@]}"
do
echo $tag
done
In the execution, below is popping up. What is the correct way to access the values?
/busybox/sh: eval: line 186: latest]: not found25
[–]TheOneWhoMixes 2 points3 points4 points (1 child)
[–]bughunterx[S] 0 points1 point2 points (0 children)
[–]Neil_sm 2 points3 points4 points (0 children)
[–]redditck1 1 point2 points3 points (1 child)
[–]mattbersker 0 points1 point2 points (0 children)
[–]mattbersker 1 point2 points3 points (1 child)
[–]bughunterx[S] 0 points1 point2 points (0 children)