"Invalid action configuration Did not find the image definition file imagedefinitions.json in the input artifacts ZIP file. Verify the file is stored in your pipeline's Amazon S3 artifact bucket"
getting this error, i did not user codebuild in AWS and image is directil pushed to ECR , we build that image with maven, i have uploaded imagedefinitions.json to the artifi bucket , i also zipped that file ,but nothing worked,
can any one suggest anything
When you are using ECR as a source, ECR generates an artifact file called 'imageDetail.json' which is of the format [1]. But the ECS Deploy stage requires a file called 'imagedefinitions.json' which is formatted differently [2].
To provide the required file, please add a CodeBuild step betweenn source and deploy with the following buildspec: (Basically converting the file)
version: 0.2
phases:
install:
runtime-versions:
docker: 18
build:
commands:
- apt-get install jq -y
- ContainerName="todo"
- ImageURI=$(cat imageDetail.json | jq -r '.ImageURI')
- printf '[{"name":"CONTAINER_NAME","imageUri":"IMAGE_URI"}]' > imagedefinitions.json
- sed -i -e "s|CONTAINER_NAME|$ContainerName|g" imagedefinitions.json
- sed -i -e "s|IMAGE_URI|$ImageURI|g" imagedefinitions.json
- cat imagedefinitions.json
artifacts:
files:
- imagedefinitions.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With