AWS CodePipeline“需要AppApp文件,但在修订中找不到" [英] AWS CodePipeline "An AppSpec file is required, but could not be found in the revision"

查看:227
本文介绍了AWS CodePipeline“需要AppApp文件,但在修订中找不到"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to set up a deployment pipeline using CodeCommit, ECR and ECS. My pipeline passes the source and build steps fine. I can deploy manually via CodeDeploy if I upload my appspec.yaml file to an s3 bucket. Deploys triggered by a change to my CodeCommit repository always fail with the error:

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

An AppSpec file is required, but could not be found in the revision

当我查看失败的部署的详细信息时,我可以拉起修订位置,显示如下:

When I look at the details of the failed deployment, I can pull up the revision location, which shows this:

我在问题排查中看到代码部署部分,某些编辑器可能会引起问题.我在Linux上使用vscode,所以我认为这不是问题.另外,如果我将相同的appspec文件上传到s3并从手动部署中引用它,则效果很好.

I see in the troubleshooting code deploy section that some editors can cause issues. I'm using vscode on linux, so I don't think that should be an issue. Also, if I upload the same appspec file to s3 and reference it from a manual deployment, it works fine.

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

I've also tried uploading the same file, but named appspec.yml. Still failed.

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

The role that this deployment uses has full s3 access, not sure if it could be any other permissions-related problem.

这是我的代码管道定义:

Here is my codepipeline definition:

{
"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
}

}

推荐答案

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

"An AppSpec file is required, but could not be found in the revision"

以上错误与您的代码管道配置错误有关.要执行ECS代码部署,在部署的代码管道阶段中的提供程序必须为"ECS(蓝色/绿色)",而不是"Codedeploy"(codedeploy用于EC2部署.)

The above error is related to the wrong configuration for your codepipeline. To perform ECS codedeploy deployments, the provider in your codepipeline stage for deployment must be "ECS (blue/green)" not "Codedeploy" (codedeploy is used for EC2 deployments.)

即使在后端使用codedeploy,提供程序的名称也为"ECS(蓝色/绿色)".

Even though in the back-end it uses codedeploy, the name of the provider is "ECS (blue/green)".

这篇关于AWS CodePipeline“需要AppApp文件,但在修订中找不到"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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