wellcomecollection / platform

Wellcome Collection Digital Platform
https://developers.wellcomecollection.org/
MIT License
48 stars 10 forks source link

Properly version deployed assets #18

Closed jtweed closed 7 years ago

alexwlchan commented 7 years ago

Currently the sbt ecr:push step (circle.yml L36) will push to the "latest" label/tag in ECR.

Really it should push to a label matching the version in build.sbt.

alexwlchan commented 7 years ago

We’re already creating tagged images: for example, this is what I have locally:

$ docker images | grep wellcome/platform | awk '{print $2}'
v0.1.2-SNAPSHOT
v0.1.1-SNAPSHOT
latest

But if I do an ecr:push, I don’t see it showing up – it could be that it’s only pushing latest, but I don’t think that would explain why new Circle builds (which don’t have old images lying around) aren’t pushing images with a non-latest tag.

kenoir commented 7 years ago

Suspect the following change might work:

https://github.com/wellcometrust/platformprototype/blob/master/platform-api/build.sbt#L94:

// repositoryName   in ecr := name.value
// Try this instead:
repositoryName   in ecr := s"${name.value}:${version.value}"

Because:

https://github.com/sbilinski/sbt-ecr/blob/master/src/main/scala/sbtecr/EcrPlugin.scala#L52

alexwlchan commented 7 years ago

That was disappointingly simple, but it works.

alexwlchan commented 7 years ago

This was based on the old version of the application and it works, doing this for the Finatra stuff is a separate task.

kenoir commented 7 years ago

Current project makes use of https://github.com/sbt/sbt-git to version assets.