codeship-library / aws-utilities

Docker images and scripts to deploy to AWS
MIT License
56 stars 44 forks source link

How to tag the image with commitId? #73

Closed victor-prp closed 6 years ago

victor-prp commented 6 years ago

I would like to tag the deployed image with the git commit id. This is very useful in order to use this image in the most precise way.

I have tried to add a tag as a suffix of the image name (:001) so my codeship-steps.yml was:

Unfortunately, it had deployed the image with tag 'latest' in aws ecr.

I addition, I would like to tag it with git commit id (as already mentioned).

Is it possible? If yes, it would be very helpful to add corresponding instructions to the readme.

Thx a lot.

beauallison commented 6 years ago

In your example the key is incorrect; it's image_tag, not tag (seems to be a mixed documentation issue on this).

The Push to Tags documentation mentions using things like Git Commit ID or Branch. Eg

image_tag: "{{ .CommitID }}"

Hope this helps!

victor-prp commented 6 years ago

Works. Thanks a lot

mlocher commented 6 years ago

Thanks @beauallison for jumping on this. I'm going to close this since the answer is absolutely correct.