I am trying to build/push an image to ECR however it fails on the tagging step.
Drone version: v0.8
step from .drone.yml file:
image: plugins/ecr
settings:
access_key:
from_secret: AWS_ACC_ID
secret_key:
from_secret: AWS_KEY_ID
create_repository: true
repo: $${AWS_ACCOUNT}.dkr.ecr.eu-west-2.amazonaws.com/foo
registry: $${AWS_ACCOUNT}.dkr.ecr.eu-west-2.amazonaws.com
region: eu-west-2
tags:
- latest
- $${DRONE_COMMIT_SHA}
secrets:
- AWS_ACC_ID
- AWS_KEY_ID
- AWS_ACCOUNT
when:
event: push
And the error from Drone logs:
Error parsing reference: "xxxxx.dkr.ecr.us-east-1.amazonaws.com/:latest" is not a valid repository/tag: invalid reference format
Notice the region mismatch in the config and in the error message. Is this plugin not supported by Drone v0.8?
the syntax in your example mixes Drone 1.x syntax with Drone 0.8 syntax. As a result, when 0.8 parses the yaml, it ignores the unrecognized 1.x syntax and therefore does not register the plugin settings. Because 0.8 is end of life and is no longer being supported, we recommend upgrading to 1.x
Is there v0.8 documentation for this plugin that I can cross check as no matter how I change the syntax the settings are being ignored?
Current setup which is failing with the same error:
image_to_aws:
image: plugins/ecr
settings:
debug: true
create_repository: true
environment:
- AWS_ACCESS_KEY_ID=$${AWS_ACC_ID}
- AWS_SECRET_ACCESS_KEY=$${AWS_KEY_ID}
- AWS_REGION=eu-west-2
repo: $${AWS_ACCOUNT}.dkr.ecr.eu-west-2.amazonaws.com/foo
registry: $${AWS_ACCOUNT}.dkr.ecr.eu-west-2.amazonaws.com
tags:
- latest
- $${DRONE_COMMIT_SHA}
secrets:
- AWS_ACC_ID
- AWS_KEY_ID
- AWS_ACCOUNT
when:
event: push
The settings
section is for 1.x only. Unfortunately we do not have any plugin documentation for 0.8
Okay thanks. I’ll post the working config once done.
Have not managed to get this working so built a custom plugin instead.