我设置了一个AWS CodePipeline,它使用github作为源,使用CodeBuild进行构建,并部署到ElasticBeanstalk。
当控制台中的所有内容都设置好并且我是github帐户的管理员时(我使用了另一个帐户进行测试),我能够使它正常工作
我需要部署的实际代码属于我不是管理员的帐户,因此在this guide之后,我收到了个人访问令牌,并使用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","provider": "CodeBuild"
},"outputArtifacts": [
{
"name": "BuildArtifact"
}
],"configuration": {
"ProjectName": "xxx-stage-codebuild"
},{
"name": "Deploy","actions": [
{
"inputArtifacts": [
{
"name": "BuildArtifact"
}
],"name": "Deploy","actionTypeId": {
"category": "Deploy","provider": "ElasticBeanstalk"
},"outputArtifacts": [],"configuration": {
"ApplicationName": "xxx","EnvironmentName": "xxx-stage"
},"runOrder": 1
}
]
}
],"artifactStore": {
"type": "S3","location": "xxx-artifacts-stage"
},"name": "xxx-stage","version": 15
}
}