AWS CodePipeline“需要一个AppSpec文件,但在修订版中找不到”

问题描述 投票:0回答:1

我正在尝试使用CodeCommit,ECR和ECS建立部署管道。我的管道可以通过源代码并构建良好的步骤。如果将appspec.yaml文件上传到s3存储桶,则可以通过CodeDeploy手动部署。由对我的CodeCommit存储库的更改触发的部署始终失败,并显示以下错误:

需要一个AppSpec文件,但在修订版中找不到

当我查看失败的部署的详细信息时,我可以拉出修订位置,这显示了这一点:

revision zip file contents

我在troubleshooting code deploy部分中看到某些编辑器可能会引起问题。我在Linux上使用vscode,所以我认为这不是问题。另外,如果我将same appspec file上传到s3并从手动部署中引用它,则可以正常工作。

我也尝试过上传相同的文件,但命名为appspec.yml。仍然失败。

此部署使用的角色具有完整的s3访问权限,不确定是否可能是其他任何与权限相关的问题。

这是我的代码管道定义:

{
"pipeline": {
    "roleArn": "arn:aws:iam::690517313378:role/service-role/AWSCodePipelineServiceRole-us-east-1-blottermappertf", 
    "stages": [
        {
            "name": "Source", 
            "actions": [
                {
                    "inputArtifacts": [], 
                    "name": "Source", 
                    "region": "us-east-1", 
                    "actionTypeId": {
                        "category": "Source", 
                        "owner": "AWS", 
                        "version": "1", 
                        "provider": "CodeCommit"
                    }, 
                    "outputArtifacts": [
                        {
                            "name": "SourceArtifact"
                        }
                    ], 
                    "configuration": {
                        "PollForSourceChanges": "false", 
                        "BranchName": "master", 
                        "RepositoryName": "blottermapper"
                    }, 
                    "runOrder": 1
                }
            ]
        }, 
        {
            "name": "Build", 
            "actions": [
                {
                    "inputArtifacts": [
                        {
                            "name": "SourceArtifact"
                        }
                    ], 
                    "name": "Build", 
                    "region": "us-east-1", 
                    "actionTypeId": {
                        "category": "Build", 
                        "owner": "AWS", 
                        "version": "1", 
                        "provider": "CodeBuild"
                    }, 
                    "outputArtifacts": [
                        {
                            "name": "BuildArtifact"
                        }
                    ], 
                    "configuration": {
                        "ProjectName": "blottermapper", 
                        "EnvironmentVariables": "[{\"name\":\"REPOSITORY_URI\",\"value\":\"690517313378.dkr.ecr.us-east-1.amazonaws.com/net.threeninetyfive\",\"type\":\"PLAINTEXT\"}]"
                    }, 
                    "runOrder": 1
                }
            ]
        }, 
        {
            "name": "Deploy", 
            "actions": [
                {
                    "inputArtifacts": [
                        {
                            "name": "BuildArtifact"
                        }
                    ], 
                    "name": "Deploy", 
                    "region": "us-east-1", 
                    "actionTypeId": {
                        "category": "Deploy", 
                        "owner": "AWS", 
                        "version": "1", 
                        "provider": "CodeDeploy"
                    }, 
                    "outputArtifacts": [], 
                    "configuration": {
                        "ApplicationName": "blottermappertf", 
                        "DeploymentGroupName": "blottermappertf"
                    }, 
                    "runOrder": 1
                }
            ]
        }
    ], 
    "artifactStore": {
        "type": "S3", 
        "location": "codepipeline-us-east-1-634554346591"
    }, 
    "name": "blottermappertf", 
    "version": 1
}, 
"metadata": {
    "pipelineArn": "arn:aws:codepipeline:us-east-1:690517313378:blottermappertf", 
    "updated": 1573712712.49, 
    "created": 1573712712.49
}

}

amazon-web-services aws-code-deploy
1个回答
0
投票

我在这里找到答案:

The deployment specifies that the revision is a null file, but the revision provided is a zip file

我在设置部署时使用了错误的操作提供程序。我选择了ECS,应该选择ECS蓝色/绿色。

模棱两可的错误消息使我难以调试和在堆栈溢出时寻找答案。

© www.soinside.com 2019 - 2024. All rights reserved.