amazon-web-services - AWS CodePipeline 从 CloudFormation 模板添加 Github 源
问题描述
我正在使用本教程中的 Cloudformation 堆栈:
https://aws.amazon.com/blogs/compute/continuous-deployment-for-serverless-applications/
它创建一个以 CodeCommit 存储库为源的管道。我想将其切换到 Github 存储库。这是定义此资源的代码:
Pipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
ArtifactStore:
Location: !Ref BuildArtifactsBucket
Type: S3
Name: !Sub ${ServiceName}_pipeline
RoleArn: !GetAtt PipelineExecutionRole.Arn
Stages:
- Name: Source
Actions:
- Name: CodeCommitRepo
ActionTypeId:
Category: Source
Owner: AWS
Provider: CodeCommit
Version: 1
Configuration:
RepositoryName: !Sub '${ServiceName}_repo'
BranchName: master
OutputArtifacts:
- Name: SourceZip
RunOrder: 1
GitHub 如何定义为资源以及如何处理私有存储库的身份验证?
解决方案
例如,对于 github,您需要用 github 替换提供者
Pipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
ArtifactStore:
Location: !Ref BuildArtifactsBucket
Type: S3
Name: !Sub ${ServiceName}_pipeline
RoleArn: !GetAtt PipelineExecutionRole.Arn
Stages:
- Name: Source
Actions:
- Name: GithubRepo
ActionTypeId:
Category: Source
Owner: ThirdParty
Provider: GitHub
Version: 1
Configuration:
"Owner": "MyGitHubAccountName",
"Repo": "MyGitHubRepositoryName",
"PollForSourceChanges": "false",
"Branch": "master",
"OAuthToken": "****"
OutputArtifacts:
- Name: SourceZip
RunOrder: 1
更多信息请点击
在这里,是如何获取 github 个人令牌并将其插入到您的代码管道中
推荐阅读
- php - 在 Connection.php 第 664 行:找不到驱动程序
- c# - InvalidOperationException:没有为此 DbContext 配置数据库提供程序。
- python - 根据 idx 系列设置 Dataframe 值
- javascript - 反应应用程序渲染空白页面,控制台没有错误
- c - 使用 fread 读取包含空字符和文本的文本文件
- sql-server - SQL除法精度/损失浮点数x小数
- python - 在 pandas 中提取多索引类型
- api - 我需要多少个 Google Maps API 密钥?
- html - Katalon Studio 找不到 svg 标签来创建对象
- vim - 修改 vim-fugitive Gstatus 映射