2015-02-09 31 views
2

我想设置我的appspec.yml文件的权限,但我不断收到关于重复权限设置一个错误,当我运行部署AWS CodeDeploy复制许可

复制权限设置指令 /数据/ HTML/httpdocs资料/工匠

这是目前(与除列表格式)的许可对象是如何在我的appspec.yml配置,按照本threads建议。我实际上有多个文件,我想要不同的权限,但我似乎无法让它工作w /只有一个文件?什么是正确的方式?

permissions: 
    - object: /data/html/httpdocs/ 
    pattern: "**" 
    except: [/data/html/httpdocs/artisan] 
    owner: ubuntu 
    group: www-data 
    mode: 644 
    type: 
     - file 
    - object: /data/html/httpdocs/artisan 
    owner: ubuntu 
    group: www-data 
    mode: 755 
    type: 
     - file 

回答

3

我刚碰到类似的问题,最后我不得不深入研究codedeploy-agent源代码。

除了CodeDeploy权限选项外,(文档记录不完善)当前接受相对文件名的数组。您应该能够像这样匹配您的工匠文件:

permissions: 
    - object: /data/html/httpdocs/ 
    pattern: "**" 
    except: [artisan] 
    owner: ubuntu 
    group: www-data 
    mode: 644 
    type: 
     - file 
    - object: /data/html/httpdocs/artisan 
    owner: ubuntu 
    group: www-data 
    mode: 755 
    type: 
     - file 

请注意,这不适用于嵌套在文件夹内的文件夹或文件。您可以使用通配符,但它们只会匹配该对象根目录的异常。

因为这个,我不得不将一些脚本从子文件夹移动到根目录。

Here's a link到相关的codedeploy-agent代码。