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

2024-01-22

我正在尝试使用 CodeCommit、ECR 和 ECS 设置部署管道。我的管道很好地通过了源代码和构建步骤。如果我上传我的文件,我可以通过 CodeDeploy 手动部署appspec.yaml文件到 s3 存储桶。由 CodeCommit 存储库更改触发的部署总是失败并出现以下错误:

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

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

我看到在代码部署疑难解答 https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting-general.html#troubleshooting-text-editors某些编辑器可能会导致问题的部分。我在 Linux 上使用 vscode,所以我认为这不应该是一个问题。另外,如果我上传相同的应用程序规范文件到 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
}

}


“需要 AppSpec 文件,但在修订版本中找不到”

上述错误与您的 codepipeline 配置错误有关。要执行 ECS codedeploy 部署,codepipeline 阶段中用于部署的提供程序必须是“ECS(蓝色/绿色)”而不是“Codedeploy”(codedeploy 用于 EC2 部署。)

尽管在后端它使用codedeploy,但提供程序的名称是“ECS(蓝/绿)”。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

AWS CodePipeline“需要 AppSpec 文件,但在修订版本中找不到” 的相关文章

随机推荐