经过更多研究,我意识到我的第一个答案是错误的,您可以使用AWS CLI使用Github OAuth令牌创建CodePipeline。然后,您可以从那里插入CodeDeploy部署。下面是一个例子配置:
{
"pipeline": {
"roleArn": "arn:aws:iam::99999999:role/AWS-CodePipeline-Service",
"stages": [
{
"name": "Source",
"actions": [
{
"inputArtifacts": [],
"name": "Source",
"actionTypeId": {
"category": "Source",
"owner": "ThirdParty",
"version": "1",
"provider": "GitHub"
},
"outputArtifacts": [
{
"name": "MyApp"
}
],
"configuration": {
"Owner": "myusername",
"Repo": "myrepo",
"Branch": "master",
"OAuthToken": "**************"
},
"runOrder": 1
}
]
},
{
"name": "Beta",
"actions": [
{
"inputArtifacts": [
{
"name": "MyApp"
}
],
"name": "CodePipelineDemoFleet",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"version": "1",
"provider": "CodeDeploy"
},
"outputArtifacts": [],
"configuration": {
"ApplicationName": "CodePipelineDemoApplication",
"DeploymentGroupName": "CodePipelineDemoFleet"
},
"runOrder": 1
}
]
}
],
"artifactStore": {
"type": "S3",
"location": "codepipeline-us-east-1-99999999"
},
"name": "MySecondPipeline",
"version": 1
}
}
您可以使用以下命令创建的管道:
aws codepipeline create-pipeline --cli-input-json file://input.json
确保Github上的OAuth令牌有权限admin:repo_hook
和repo
。
参考:http://docs.aws.amazon.com/cli/latest/reference/codepipeline/create-pipeline.html
你确定你回答正确的问题? – Martin
是的。他要求在没有github用户的情况下进行部署 –
我问如何在没有Github用户的情况下使用AWS CodeDeploy产品,同时仍然使用他们提供的与Github的集成。在这种情况下,你的回答没有意义。 – Martin