copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Copilot adds "latest" tag to builds, need per branch tags

Open chrisschaub opened this issue 1 year ago • 1 comments

I've been trying to wrap my head around the issues to having a single ECR repository with images tagged by branch, or separate ECR repos per branch. I need the "qa" branch build and deploy to always just use the qa built code. It seems the "latest" tag is geting added to the latest build, I worry that is being deployed by default. What is the best approach to ensure that "qa" builds a qa image and that is what gets deployed, vs production etc. Is it simplest to just have copilot make ECR repos per branch and that way the "latest" will always get deployed? I don't want to do anything manually, just want this to all work with pipelines on github push. Thanks!

chrisschaub avatar Jan 25 '24 15:01 chrisschaub

This is a great question yeah! Basically, running svc deploy or svc package --upload-assets you can add the --tag flag to tag the image uploaded. This is actually what we do in the buildspec.yml file for pipelines, so in order to get the functionality you're looking for you need to modify this buildspec file. This should let you tag the uploaded builds with the branch name all under one ECR repository.

There's an old discussion of others trying to do similar things here. Let me know if you have any other questions on how to get this working.

CaptainCarpensir avatar Jan 26 '24 19:01 CaptainCarpensir

This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.

github-actions[bot] avatar Mar 27 '24 00:03 github-actions[bot]

This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions!

github-actions[bot] avatar Apr 10 '24 00:04 github-actions[bot]