Jenkins触发代码部署在ApplicationStop步骤失败,即使直接通过代码部署的相同部署组正在运行成功 [英] Jenkins triggered code deploy is failing at ApplicationStop step even though same deployment group via code deploy directly is running successfully

查看:215
本文介绍了Jenkins触发代码部署在ApplicationStop步骤失败,即使直接通过代码部署的相同部署组正在运行成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过Jenkins(代码部署插件)触发时,我收到以下错误 -

 没有这样的文件或目录 - /opt/codedeploy-agent/deployment-root/edbe4bd2-3999-4820-b782-42d8aceb18e6/d-8C01LCBMG/deployment-archive/appspec.yml 

但是,如果我直接通过代码部署触发部署到同一部署组,并在S3(通过Jenkins触发器获取)中指定相同的zip,则此步骤将通过。



这是什么意思,我该如何找到解决办法?我正在努力整合几件事情,所以,需要通过代码部署和通过Jenkins同时部署。当我需要确保较小的单元运行良好时,我将运行代码部署触发部署。



更新



只要提及另一点,以备适用。我以前在同一个ec2实例上使用了一个不同的代码部署应用程序和部署组,并且直接使用jenkins和代码部署。为了解决一些问题(据称,不允许由于部署失败而覆盖现有文件),我已经删除了包含部署的 / opt / codedeploy-agent / deployment-root /<目录中的所有内容。 目录,尝试按照此答案中提及的内容。但是,请注意,我只删除该目录中的项目。此后,我开始收到这个错误appspec.yml在部署档案中找不到。所以,然后我创建了一个新的应用程序和部署组,从那时起,我正在处理它。另外要考虑的一点是我是否应该进一步的清理,如果jenkins触发部署仍然受到这些删除的影响(即使它是指新的应用程序和部署组)。

解决方案

作为其进程的一部分,CodeDeploy需要引用以前的部署重新部署和部署回滚操作。这些引用在部署归档文件夹之外进行维护。如果您手动删除这些存档,则CodeDeploy安装可能会被致命地损坏:先前部署中的引用不再正确或一致,部署将失败。



此时最好的事情是彻底删除旧的安装,然后重新安装。这将允许代码部署代理再次正常工作。



我已经学会了不删除/修改任何的CodeDeploy安装文件夹或文件。即使您更改了应用程序或部署组,CodeDeploy也可以自己设计出来,而无需手动清理。


When I trigger via Jenkins (code deploy plugin), I get the following error -

 No such file or directory - /opt/codedeploy-agent/deployment-root/edbe4bd2-3999-4820-b782-42d8aceb18e6/d-8C01LCBMG/deployment-archive/appspec.yml

However, if I trigger deployment into the same deployment group via code deploy directly, and specify the same zip in S3 (obtained via Jenkins trigger), this step passes.

What does this mean, and how do I find a workaround to this? I am currently working on integrating a few things and so, will need to deploy via code deploy and via Jenkins simultaneously. I will run the code deploy triggered deployment when I will need to ensure that the smaller unit is functioning well.

Update

Just mentioning another point, in case it applies. I was previously using a different codedeploy "application" and "deployment group" on the same ec2 instances, and deplying using jenkins and code deploy directly as well. In order to fix some issue (not allowing to overwrite existing files due to failed deployments, allegedly), I had deleted everything inside the /opt/codedeploy-agent/deployment-root/<directory containing deployments> directory, trying to follow what was mentioned in this answer. However, note that I deleted only items inside that directory. Thereafter, I started getting this error appspec.yml not found in deployment archive. So, then I created a new application and deployment group and since then, I am working on it.

So, another point to consider is whether I should do some further cleanup, if the jenkins triggered deployment is somehow still affected by those deletions (even though it is referring to the new application and deployment group).

解决方案

As part of its process, CodeDeploy needs to reference previous deployments for Redeployments and Deployment Rollbacks operations. These references are maintained outside of the deployment archive folders. If you delete these archives manually as you indicate, then a CodeDeploy install can get fatally corrupted: the references left to previous deployments are no longer correct or consistent, and deploys will fail.

The best thing at this point is to remove the old installation completely, and re-install. This will allow the code deploy agent to work correctly again.

I have learned the hard way not to remove/modify any of the CodeDeploy install folders or files manually. Even if you change apps or deployment groups, CodeDeploy will figure it out itself, without the need for any manual cleanup.

这篇关于Jenkins触发代码部署在ApplicationStop步骤失败,即使直接通过代码部署的相同部署组正在运行成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆