I'm deploying an application with elastic beanstalk, which has its own deploy tool. This tool takes the latest commit, creates a zip from it, and deploys that to the cloud. To verify the deploy on each server, I'd like it to be able to report its own SHA once it has been deployed. There are actually a few valid approaches:
I solved this with .gitattribtues export-subst. (http://git-scm.com/docs/gitattributes) This automatically adds the SHA to the repo when it is archived, which is what elastic-beanstalk does upon deploy.
My .gitattributes:
*.py diff=python
version.txt export-subst
My version.txt:
$Format:%H$
See https://stackoverflow.com/a/16365314/478354
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