我想在我的 gitlab ci/cd yml 文件的变量中使用数组,如下所示:
variables:
myarrray: ['abc', 'dcef' ]
....
script: |
echo myarray[0] myarray[1]
但 Lint 告诉我文件不正确:
variables config should be a hash of key value pairs, value can be a hash
我试过下一个:
variables:
arr[0]: 'abc'
arr[1]: 'cde'
....
script: |
echo $arr[0] $arr[1]
但是构建失败并打印出 bash 错误:
bash: line 128: export: `arr[0]': not a valid identifier
有没有办法在 .gitlab-ci.yml 文件中使用数组变量?