我设置了一个 AWS CodePipeline,它使用 github 作为源,CodeBuild 用于构建,并部署到 ElasticBeanstalk。
当一切都在控制台中设置好并且我是 github 帐户的管理员时,我能够让它工作(我使用不同的帐户进行测试)
我需要部署的实际代码属于我不是管理员的帐户,因此按照本指南,我收到了个人访问令牌并使用 CLI 更新了 CodePipeline。
一旦我使用 cli 更新了项目,它就不会在提交代码时被触发。
我不确定发生了什么变化,因为即使我使用控制台并将 webhook 直接设置为我正在测试的 github 帐户的管理员,它仍然无法正常工作。
这是我更新管道的 json:
{
"pipeline": {
"roleArn": "arn:aws:iam::xxxxxxx:role/service-role/AWSCodePipelineServiceRole-us-west-2-xxxxx-xxxx",
"stages": [
{
"name": "Source",
"actions": [
{
"inputArtifacts": [],
"name": "Source",
"actionTypeId": {
"category": "Source",
"owner": "ThirdParty",
"version": "1",
"provider": "GitHub"
},
"outputArtifacts": [
{
"name": "SourceArtifact"
}
],
"configuration": {
"Owner": "xxx",
"Repo": "xxx",
"PollForSourceChanges": "false",
"Branch": "stage"
},
"runOrder": 1
}
]
},
{
"name": "Build",
"actions": [
{
"inputArtifacts": [
{
"name": "SourceArtifact"
}
],
"name": "Build",
"actionTypeId": {
"category": "Build",
"owner": "AWS",
"version": "1",
"provider": "CodeBuild"
},
"outputArtifacts": [
{
"name": "BuildArtifact"
}
],
"configuration": {
"ProjectName": "xxx-stage-codebuild"
},
"runOrder": 1
}
]
},
{
"name": "Deploy",
"actions": [
{
"inputArtifacts": [
{
"name": "BuildArtifact"
}
],
"name": "Deploy",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"version": "1",
"provider": "ElasticBeanstalk"
},
"outputArtifacts": [],
"configuration": {
"ApplicationName": "xxx",
"EnvironmentName": "xxx-stage"
},
"runOrder": 1
}
]
}
],
"artifactStore": {
"type": "S3",
"location": "xxx-artifacts-stage"
},
"name": "xxx-stage",
"version": 15
}
}