openshift / ansible-service-broker

Ansible Service Broker
Apache License 2.0
228 stars 84 forks source link

tag source tree when building images #86

Closed jmrodri closed 7 years ago

jmrodri commented 7 years ago

On previous projects we used tito to build the rpms from the source tree. tito would tag the source tree and them update the version of the spec file and generate changelogs as well. This made it super easy to determine what software was included in a particular rpm.

We're not currently shipping rpms but we are building images. I'd like the image building process to tag the source tree. Something like this:

ansible-service-broker-VERSION

And when we tag images we should use that VERSION as well. That way when you go to our organization you can see that a particular version was built. We could probably build it into a tool (that's how tito was born too :)

eriknelson commented 7 years ago

+1, I'd really like to see this. I started down this path a little bit, most people probably don't know because it hasn't really been used, but the broker does have a --version, and it's in the source tree:

https://github.com/fusor/ansible-service-broker/blob/master/pkg/app/app.go#L16

It would be nice to integrate a commit sha into that as well?

Additionally, as part of the image builds, we also drop a sha file in /usr/local/ansible-service-broker/sha so you can check what the image was built from:

https://github.com/fusor/ansible-service-broker/blob/master/ansible/main.yml#L87

jmrodri commented 7 years ago

I'd want to pull version out of the source into a separate file. Which would make it easier to dynamically update. Then have the app.go read from that file.

So that sha is great. I think we should tag that in the process. Not sure how to do that from ansible. I know @rthallisey is also working in a branch for building stuff without ansible-container which I'm totally ok with.

jmrodri commented 7 years ago

Basically I'd want to run:

make asb-image

At the end I should see a git tag in tig, then be able to see the same version tag in dockerhub. And the version would be bumped when we hit --version on the broker.

jmrodri commented 7 years ago

Fixed by PRs #204 #212 #365 #375 #382