git - Is there Environment variable for Amazon ElasticBeanstalk containers for the deployed version? -


i'm trying make deployment hook when deploy php application eb send application code version or git commit point, possibly git tag if 1 exists analytics service.

i wandering if there's environment variables set on instances version they're running or if copies of git data instance that's been deployed part of eb setup?

afaik, when elastic beanstalk deploys application cloud, creates archive git archive command. resulting archive file not have repository metadata. although elastic beanstalk using commit sha1 part of version name, if using own versioning schema, sha1 might not available.

as alternative, can create shell script send commit information analytics service. git alias can execute script , aws.push 1 command.

# .git/config  [alias "custom"]         push = !git aws.push $1 && ./custom.sh   # custom.sh  commit=$(git rev-parse head) echo 'send info analytics service commit: ' $commit 

then execute $ git custom.push

in example above, custom.sh executed when aws.push resulted in error, if need more reliable solution, might want integrate tighter .git/awsdevtools/aws.elasticbeanstalk.push script itself.

hope helps.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -