AWS CodePipeline Concepts: Difference between revisions
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
==Action Types== | ==Action Types== | ||
Currently, six types of actions are supported: | |||
* [[#Source|Source]] | |||
* [[#Build|Build]] | |||
* [[#Test|Test]] | |||
* [[#Deploy|Deploy]] | |||
* [[#Approval|Approval]] | |||
* [[#Invoke|Invoke]] | |||
===<span id='Source_Action'></span>Source=== | ===<span id='Source_Action'></span>Source=== | ||
Line 78: | Line 86: | ||
RunOrder: 1 | RunOrder: 1 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===<span id='Test_Action'></span>Test=== | |||
==Deploy Action== | ==Deploy Action== |
Revision as of 16:16, 14 March 2019
External
Internal
Stage
Action
An action is a task performed on an artifact, executed as part of the sequence in the stage of a pipeline. The action may occur in a specified order, or in parallel, depending on their configuration.
Action Name
An action name must match the regular expression pattern: [A-Za-z0-9.@\-_]+
Action Types
Currently, six types of actions are supported:
Source
Resources:
MyPipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
...
Stages:
- Name: Source
Actions:
- InputArtifacts: []
Name: !Sub 'PullBranch-${Branch}'
ActionTypeId:
Category: Source
Owner: ThirdParty
Version: '1'
Provider: GitHub
OutputArtifacts:
- Name: ContainerSrc
Configuration:
Owner: 'novaordis-llc'
Repo: !Sub '${GitHubOrganizationUrl}/${GitHubRepositoryName}'
Branch: !Ref Branch
OAuthToken: ...
RunOrder: 1
GitHub Authentication
Build
Resources:
MyPipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
...
Stages:
...
- Name: Build
Actions:
- Name: !Sub 'CodeBuild build driven by ${Buildspec}'
ActionTypeId:
Category: Build
Owner: AWS
Version: '1'
Provider: CodeBuild
InputArtifacts:
- Name: ContainerSrc
OutputArtifacts:
- Name: ContainerBuild
Configuration:
ProjectName: !Ref CodeBuildProject
RunOrder: 1
Test
Deploy Action
Resources:
MyPipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
...
Stages:
...
- Name: Deploy
Actions:
- Name: Deploy
ActionTypeId:
Category: Deploy
Owner: AWS
Version: '1'
Provider: CloudFormation
InputArtifacts:
- Name: ContainerSrc
- Name: ContainerBuild
Configuration:
StackName: !Join ['-', [!Sub '${AWS::Region}', !Join ['-', !Split ['.', !Ref GitHubRepositoryName]], 'deploy']]
ActionMode: CREATE_UPDATE
Capabilities: CAPABILITY_IAM
TemplatePath: !Sub ContainerSrc::${SvcTemplate}
TemplateConfiguration: ContainerBuild::overrides.json
ParameterOverrides: !Sub '{ "ECRRepository": "${ECRRepository}", "EnvironmentName": "${CFEnvironment}", "Image": "${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${ECRRepository}", "DeploymentStackName": "${DeploymentStackName}", "GitHubRepo": "${GitHubRepositoryName}" }'
RoleArn:
Fn::ImportValue: !Sub '${AWS::Region}-CloudFormationDeploymentRole'
OutputArtifacts: []
RunOrder: 1
Notes to organize:
- The parameters specified in the "ParameterOverrides" must match with the sub-template parameters.
- If "override.json" is declared as "TemplateConfiguration" and the previous build task does not create the override.json file, the deployment stage will fail with an S3 error.