简体   繁体   English

amazon beanstalk ec2 instance当前git sha

[英]amazon beanstalk ec2 instance current git sha

How can I get current git sha of the commit that was git aws.push ? 我怎样才能获得git aws.push提交的当前git sha? My container_commands need to download a file on a server that has that head git sha as the file name so I need a way to determine it. 我的container_commands需要在具有头git sha作为文件名的服务器上下载文件,所以我需要一种方法来确定它。

I've been browsing around /opt/elasticbanstalk/ and found file /opt/elasticbeanstalk/deploy/configuration/appsourceurl which contains 我一直在浏览/opt/elasticbanstalk/并找到包含的文件/opt/elasticbeanstalk/deploy/configuration/appsourceurl

"url": "https://elasticbeanstalk-us-west-43434324.s3.amazonaws.com/resources%2Fenvironments%2Dg-fea2ffeaf5%2F_runtime%2F_versions%2Fbb-test-eb%2Fgit-6cb3416a7a5a84ce864dd0213236984age4b0b9-2678564154681?Expires=1417813357&AWSAccessKeyId=-----&Signature=-----"

I could parse this and extract the git-sha the problem this git sha is different from my git head sha on local that I just git aws.pushed! 我可以解析这个并提取git-sha这个git sha与我当地的git head sha不同的问题我只是git aws.pushed! Why? 为什么?

You can confirm version label (aka git commit) with AWS Elastic Beanstalk API Command Line Interface : 您可以使用AWS Elastic Beanstalk API命令行界面确认版本标签(也称为git commit):

$ elastic-beanstalk-describe-applications
ApplicationName | ConfigurationTemplates | DateCreated | DateUpdated | Description | Versions
---------------------------------------------------------------------------------------------
angrywhopper |  | 2013-12-05 10:44:21 -0800 | 2013-12-05 10:44:21 -0800 | N/A | git-c069d943a152871a3a43898ce19ea20295b1307d-1386466726575

It should match your local commit: 它应该与您的本地提交匹配:

$ git rev-parse HEAD
c069d943a152871a3a43898ce19ea20295b1307d

Also, look for archive operation in the log: 另外,在日志中查找归档操作:

2013-12-08 03:51:31,830 [INFO] (10377 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: Archive:  /opt/elasticbeanstalk/deploy/appsource/source_bundle
c069d943a152871a3a43898ce19ea20295b1307d
   creating: /opt/python/ondeck/app/.ebextensions/
   ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM