aws codedeploy git revision during deploy

最后都变了- 提交于 2020-12-11 09:09:45

问题


I am running some test with AWS CodeDeploy service and managed to deploy my app from github, so far so good.

But now I need to git revision that is deployed in the AfterInstall hook. Is there a way to get the git revision?

Already looked in the deployment-archive dir but it looks like the agent is doing a git export since there is no .git directory.


回答1:


To get the specific revision deployed, you'll have to pull the deployment details from CodeDeploy as it's not currently exposed to hook scripts.

  1. Use the DEPLOYMENT_ID environment variable (set by the host agent) to get the deployment id.
  2. Call GetDeployment with the deployment id.
  3. In the response structure get the GitHub commit id from Revision -> GitHubLocation -> CommitID



回答2:


If you login to the aws console, then go to deployment, so you can choose the the which revision do you want to deploy



来源:https://stackoverflow.com/questions/32605439/aws-codedeploy-git-revision-during-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!