I am trying to use AWS CodeDeploy to pull my latest changes from Github down to a server. The problem I am running into is on the install step I am getting this error:
MessageFile already exists at location /data/sites/wordpress/api_now_playing_staging.php
And my appspec.yml looks like this:
- source: "/"
- object: /data/sites/wordpress
My question is if it git is suppose to be pulling using CodeDeploy, why am I getting file already exist error? Am I doing something wrong?
Did you deploy the same git repo with a different deployment group or did it manually before? If the same resource is already existed in the destination folder, CodeDeploy will check whether the resource in destination folder is created by the same deployment group. If you you are using the same deployment group, re-deploy shouldn’t cause this problem.
The current way CodeDeploy host agent works is to pull down the deployment artifacts and move them to the right repository according to AppSpec file. Even you deploy from a Github repo, it’s not just running git pull in the destination folder.