0
votes

I am trying to deploy my code using AWS CodeDeploy. My first deployment failed because of some typo in the appspec file. After correcting the appspec file i tried to deploy it but this time it gave me the follwing error.

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

Why is it happening? Possible workaround except for beforeInstall script.

2
hey @Daniel it seems like beforeScript is the only way.Sanjay Bisht

2 Answers

0
votes

Add below line to appspec.yml

overwrite: true

It should be something like below.

- source: web
destination: /var/www/html/
overwrite: true