AWS CodeDeploy Github文件已存在 [英] AWS CodeDeploy Github File Already Exist

查看:158
本文介绍了AWS CodeDeploy Github文件已存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用AWS CodeDeploy将我的最新更改从Github下拉到服务器。我遇到的问题是在安装步骤中,我收到了这个错误:

  Error CodeUnknownError 
脚本名称
MessageFile已存在于位置/data/sites/wordpress/api_now_playing_staging.php
Log Tail

我的appspec.yml如下所示:

 版本:0.0 
os:linux
文件:
- source:/
目的地:/ data / sites / wordpress
权限:
- object:/ data / sites / wordpress
模式:**
所有者:wp
组合:nginx
模式:755
类型:
- 文件

我的问题是,如果git被假设为使用CodeDeploy,为什么我得到的文件已经存在错误?我做错了什么?

解决方案

您是否部署了与其他部署组相同的git仓库,如果目标文件夹中已存在相同的资源,CodeDeploy将检查目标文件夹中的资源是否由相同的部署组创建。如果您使用的是相同的部署组,则重新部署不应导致此问题。

CodeDeploy主机代理工作的当前方式是根据AppSpec文件将部署构件下拉并移动到正确的存储库。即使你从Github仓库进行部署,它不仅仅是在目标文件夹中运行git pull。

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?

解决方案

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.

这篇关于AWS CodeDeploy Github文件已存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆