AWS CodeDeploy 失败:部署失败,因为此位置已存在指定文件 [英] AWS CodeDeploy Fail: The deployment failed because a specified file already exists at this location

查看:22
本文介绍了AWS CodeDeploy 失败:部署失败,因为此位置已存在指定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Github 设置 AWS 代码部署以自动化我的部署.我遇到的问题是 ec2 实例已经处于活动状态并且具有网络应用程序代码.问题是实例上还有其他我不希望受到源代码控制的内容.代码部署失败并出现以下错误:

I am trying to set AWS Code deploy with Github to automate my deloyment. the problem i am having is the ec2 instance is already active and has the web app code. the problem is there is also other content on the instance that I don't want under source control. Code deploy is failing with the following error:

The deployment failed because a specified file already exists at this location

这是因为源代码在实例上并且没有作为修订版添加.

this is because the source code is on the instance and was not added as a revision.

所以我的问题是有什么方法可以让代码部署将实例上的当前文件识别为初始修订版?

So my question is there any way to make the code deploy recognise the current files on the instance as an inital revision?

推荐答案

这是可能的!这是部署期间的一个选项:内容选项:当目标实例上的文件与应用程序修订中的文件同名且目标位置相同时,选择 AWS CodeDeploy 在部署期间要执行的操作."

This is possible! This is an option during a deployment: "Content options: Choose the action for AWS CodeDeploy to take during a deployment when a file on a target instance has the same name as a file in the application revision, for the same target location."

您可以选择失败、覆盖和保留.保留可能是您的最佳选择.

You can choose fail, overwrite and retain. Retain is probably the best choice in your case.

您可以找到更多信息

  • docs.aws.amazon.com (strangely under 'rollback')

cli docs.aws.amazon.com(见--file-exists-behavior(字符串))

cli docs.aws.amazon.com (see --file-exists-behavior (string))

这篇关于AWS CodeDeploy 失败:部署失败,因为此位置已存在指定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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