AWS CodeDeploy Fail: Deployment failed because the specified file already exists at this location

I am trying to install AWS code for deployment with Github to automate my work. The problem I am facing is an ec2 instance that is already active and has web application code. the problem is that there is other content on the instance that I do not want to use under source control. Code deployment error with the following error:

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

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

So my question is, is there a way to make the code deployment recognize the current instance files as the source version?

+5
source share
5 answers

It is possible! This is an option during deployment: "Content Options: Select the action that AWS CodeDeploy will perform during deployment if the file in the target instance has the same name as the file in the application’s edition for the same target location."

You can choose to crash, overwrite and save. Retain is probably the best choice in your case.

You can find more information.

+8
source

I had the same issue when working in CodeDeploy with EC2 instances.

  • EC2 AWS CodeDeploy. EC2 .
  • .
+1

- CodeDeploy . .

, webroot , .

, , , CodeDeploy .

+1

, CodeDeploy , . , . , , , . CodeDeploy - . , (: , - , CodeDeploy, , , , , PreInstall script ):

  • EC2 (t2.micro). , , . !

  • , .

  • YAML, BeforeInstall AfterInstall. . . , .

  • ssh ec2 ( SSH !) /opt/codedeploy -agent/deploy-root/deployment-instructions/

  • {deploy-group-identifier} -cleanup. scp ec2, . , FileZilla , ec2. , .

  • SSH ec2 /opt/codedeploy-agent/deploy-root/deployment-instructions/ . { } { } .

  • .

8.???

  1. Profit.

( 8 9... ), .

0
source

If you just want the error to disappear, you can use one of the earlier Lifecycle Hook scripts (possibly BeforeInstall) to delete this folder before the source is added to the later Hook again. If the source will not be re-added to the later Hook, add it yourself.

I got this error even on new instances, so CodeDeploy must somehow cache this folder, and then get upset about it.

0
source

Source: https://habr.com/ru/post/1666492/


All Articles