Search code examples
amazon-web-servicesdeploymentamazon-elastic-beanstalkebcli

eb create and eb deploy, How to find deployed git changeId/tag


After running eb create or eb deploy EB CLI picks the latest git commit and deploys, How can I know which git (change ID) was deployed? I hope there is an easy way to get the changeId of the deployed application.

Some of the possible cases why we need to know this is

  1. have removed my project folder after deployment
  2. There are several commits after the deployment
  3. It has been a while since I deployed my changes

Solution

  • Going forward, you can associate your EB deployments with descriptions and your choice of version labels.

    For your use case, you can specify the HEAD of your git branch as the version label:

    >> eb deploy --message "New commit" --label `git rev-parse HEAD`
    

    After the deployment completes successfully, you will be able to see that the version label associated with the deployment bears the git commit ID:

    >> eb appversion
    
    #   Version Label                              Date Created       Age       Description  
    
    2   2c7f3bc984b3501091af4026a2de24d582a5f6e0   2017/10/18 23:19   5 mins    New commit     
    1   app-171018_231247                          2017/10/18 23:12   11 mins   EB-CLI deploy