經過更多研究,我意識到我的第一個答案是錯誤的,您可以使用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