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:
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:
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?
To create a connection for AWS CodeDeploy applications to a GitHub account, sign out of GitHub in a separate web browser tab. In GitHub token name, type a name to identify this connection, and then choose Connect to GitHub. The web page prompts you to authorize CodeDeploy to interact with GitHub for your application.
Here's the steps I would take: Confirm that you installed the CodeDeploy agent. Confirm that you've created the IAM service role. Confirm that you have the IAM Instance Profile and that it's associated with the instance.
If your application uses the EC2/On-Premises compute platform, the AppSpec file must be a YAML-formatted file named appspec. yml and it must be placed in the root of the directory structure of an application's source code.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With