Question:
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:
1 2 3 4 5 |
Error CodeUnknownError Script Name MessageFile already exists at location /data/sites/wordpress/api_now_playing_staging.php Log Tail |
And my appspec.yml looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
version: 0.0 os: "linux" files: - source: "/" destination: "/data/sites/wordpress" permissions: - object: /data/sites/wordpress pattern: "**" owner: wp group: nginx mode: 755 type: - file |
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?
Answer:
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.