I’m trying to deploy with the ECR plugin and my jsonnet file looks like:
local push_to_ecr(branch) = {
name: 'build and publish to ECR_' + branch,
image: 'plugins/docker',
settings: {
repo: 'bar',
registry: '<some-account-id>.dkr.ecr.us-east-1.amazonaws.com',
region: 'us-east-1',
tags: +(
if branch == 'master' then ['someprefix_${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:8}', 'latest-manual']
else ['someprefix_${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:8}']
),
},
when: {
branch: [branch],
},
};
{
kind: 'pipeline',
name: 'default',
steps: [
push_to_ecr('develop'),
push_to_ecr('master'),
]
}
The error I’m getting is:
RUNTIME ERROR: Unexpected type array, expected number .drone.jsonnet:(8:11)-(11:6) object <anonymous> During manifestation
What i’ve tried is:
jsonnetfmt -i .drone.jsonnet
drone jsonnet --stdout
Looked fine. It’s something within the tags conditional part, but I’m running out of ideas Any help is appreciated.