gpt4 book ai didi

amazon-web-services - AWS CodePipeline "An AppSpec file is required, but could not be found in the revision"

转载 作者:行者123 更新时间:2023-12-03 19:43:53 24 4
gpt4 key购买 nike

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

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



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

revision zip file contents

我在 troubleshooting code deploy 中看到部分编辑器可能会导致问题。我在 linux 上使用 vscode,所以我认为这不是问题。此外,如果我将相同的 appspec 文件上传到 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 文件,但在修订版中找不到”

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

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

关于amazon-web-services - AWS CodePipeline "An AppSpec file is required, but could not be found in the revision",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58851354/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com