AWS CodeBuild DOWNLOAD_SOURCE失败

时间:2019-11-13 12:38:02

标签: amazon-web-services amazon-s3 continuous-deployment aws-codepipeline aws-codebuild

我正在使用AWS Code Pipeline执行部署,我设法仅使用CodeBuild来执行部署,但是当我将其更改为S3源时,部署总是失败,并显示错误消息:-
Waiting for DOWNLOAD_SOURCE

我的CodeBuild项目是根据others所指出的CodePipeline创建的。我也绝望地为其分配了对S3的完全访问权限。但仍然无济于事。

我的CodeBuild项目服务角色策略如下:-

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogStream",
                "s3:*",
                "logs:PutLogEvents"
            ],
            "Resource": [
                "arn:aws:s3:::codepipeline-ap-southeast-1-625xxxxxxx/*",
                "arn:aws:s3:::codepipeline-ap-southeast-1-625xxxxxxx/octen_frontend_prod/SourceArti/*",
                "arn:aws:logs:ap-southeast-1:57313xxxxxxx:log-group:/aws/codebuild/MyApp",
                "arn:aws:logs:ap-southeast-1:57313xxxxxxx:log-group:/aws/codebuild/MyApp:*"
            ]
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "s3:PutAccountPublicAccessBlock",
                "s3:GetAccountPublicAccessBlock",
                "s3:ListAllMyBuckets",
                "s3:*",
                "s3:ListJobs",
                "s3:CreateJob",
                "s3:HeadBucket"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor2",
            "Effect": "Allow",
            "Action": "logs:CreateLogGroup",
            "Resource": [
                "arn:aws:logs:ap-southeast-1:5731xxxxxxxx:log-group:/aws/codebuild/MyApp",
                "arn:aws:logs:ap-southeast-1:5731xxxxxxxx:log-group:/aws/codebuild/MyApp:*"
            ]
        }
    ]
}

1 个答案:

答案 0 :(得分:2)

好吧..所以CodeBuild仅接受zip格式,而我为其提供了tar工件。
实际上,CodeBuild的详细信息页面下的阶段详细信息部分实际上提供了错误原因,原因是 CLIENT_ERROR: zip: not a valid zip file for primary source。我是怎么想念的,这让我感到惊讶...