Venkatesh Marepalli
Venkatesh Marepalli

Reputation: 606

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

Upvotes: 1

Views: 1911

Answers (2)

progfan
progfan

Reputation: 2526

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

Upvotes: 1

hjpotter92
hjpotter92

Reputation: 80649

You can always check against the description of the most recent deployed version. This description is the first line of your git commit message. However, as almost 80% of developers do not give meaningful commit messages, this value would be troublesome. Next comes checking the deployed version status. Running eb status generates (for my app)

Environment details for: APP-NAME
  Application name: <name>
  Region: ap-south-1
  Deployed Version: app-6d83-171010_130148
  Environment ID: e-hjab33mufj
  Platform: arn:aws:elasticbeanstalk:ap-south-1::platform/Docker running on 64bit Amazon Linux/2.7.3
  Tier: WebServer-Standard
  CNAME: APP-NAME.ap-south-1.elasticbeanstalk.com
  Updated: 2017-10-10 13:03:05.373000+00:00
  Status: Ready
  Health: Yellow
  Running instances: 1

Notice the line containing: app-6d83-171010_130148. Here 6d83 is the most uniquely identifiable commit SHA values. So, running

git show 6d83

would show you the exact commit.

Upvotes: 1

Related Questions