我缺少的一条信息是,我需要创建一个Custom Action才能使用Jenkins作为代码管道的Action提供程序。
首先,我添加了以下自定义操作:
JenkinsCustomActionType:
Type: AWS::CodePipeline::CustomActionType
Properties:
Category: Build
Provider: !Ref JenkinsProviderName
Version: 1
ConfigurationProperties:
-
Description: "The name of the build project must be provided when this action is added to the pipeline."
Key: true
Name: ProjectName
Queryable: false
Required: true
Secret: false
Type: String
InputArtifactDetails:
MaximumCount: 5
MinimumCount: 0
OutputArtifactDetails:
MaximumCount: 5
MinimumCount: 0
Settings:
EntityUrlTemplate: !Join ['',[!Ref JenkinsServerURL,"/job/{Config:ProjectName}/"]]
ExecutionUrlTemplate: !Join ['',"/job/{Config:ProjectName}/{ExternalExecutionId}/"]]
Tags:
- Key: Name
Value: custom-jenkins-action-type
jenkins服务器URL在settings
中提供了自定义操作
并且为Provider
指定了Jenkins提供程序名称。哪个是
我最初遇到的问题。
然后按以下方式配置管道阶段:
DevPipeline:
Type: AWS::CodePipeline::Pipeline
DependsOn: JenkinsCustomActionType
Properties:
Name: Dev-CodePipeline
RoleArn:
Fn::GetAtt: [ CodePipelineRole,Arn ]
Stages:
...
- Name: DevBuildVerificationTest
Actions:
- Name: JenkinsDevBVT
ActionTypeId:
Category: Build
Owner: Custom
Version: 1
Provider: !Ref JenkinsProviderName
Configuration:
ProjectName: !Ref JenkinsDevBVTProjectName
RunOrder: 4
必须在管道之前创建自定义操作。因此DependsOn: JenkinsCustomActionType
本文链接:https://www.f2er.com/3111991.html