Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Add commit info to approvals
Browse files Browse the repository at this point in the history
Added commit message and a url to the changes to the approval message in all pipelines based on cloudformation. We'll have to wait a bit until cdk supports the namespace property of actions (aws/aws-cdk#5219) before we can change those.

Reference: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html#reference-variables-list
  • Loading branch information
Justin Gondron committed Dec 11, 2019
1 parent afcc206 commit ee688fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion deploy/cloudformation/manifest-pipeline-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ Resources:
- Name: Source
Actions:
- Name: AppCode
Namespace: "AppCodeVars"
InputArtifacts: []
ActionTypeId:
Version: "1"
Expand Down Expand Up @@ -766,7 +767,7 @@ Resources:
Version: "1"
Configuration:
NotificationArn: !Ref ApprovalTopic
CustomData: !Sub "A new version of https://github.com/${GitHubUser}/${ManifestPipelineRepoName} has been deployed to the ${TestStackName} stack and is awaiting your approval. If you approve these changes, they will be deployed to the ${ProdStackName} stack."
CustomData: !Sub "A new version of https://github.com/${GitHubUser}/${ManifestPipelineRepoName}/tree/#{AppCodeVars.BranchName} has been deployed to the ${TestStackName} stack and is awaiting your approval. If you approve these changes, they will be deployed to the ${ProdStackName} stack.\n\n*Commit Message*\n#{AppCodeVars.CommitMessage}\n\nFor more details on the changes, see https://github.com/${GitHubUser}/#{AppCodeVars.RepositoryName}/commit/#{AppCodeVars.CommitId}."
RunOrder: 3

- Name: Production
Expand Down
5 changes: 3 additions & 2 deletions deploy/cloudformation/primo-passthrough-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ Resources:
- Name: Source
Actions:
- Name: AppCode
Namespace: "AppCodeVars"
InputArtifacts: []
ActionTypeId:
Version: "1"
Expand Down Expand Up @@ -423,7 +424,7 @@ Resources:
Version: "1"
Configuration:
NotificationArn: !Ref ApprovalTopic
CustomData: !Sub "A new version of https://github.com/${GitHubUser}/${PassthroughPrimoPipelineRepoName} has been deployed to the ${TestStackName} stack and is awaiting your approval. If you approve these changes, they will be deployed to the ${ProdStackName} stack."
CustomData: !Sub "A new version of https://github.com/${GitHubUser}/${PassthroughPrimoPipelineRepoName}/tree/#{AppCodeVars.BranchName} has been deployed to the ${TestStackName} stack and is awaiting your approval. If you approve these changes, they will be deployed to the ${ProdStackName} stack.\n\n*Commit Message*\n#{AppCodeVars.CommitMessage}\n\nFor more details on the changes, see https://github.com/${GitHubUser}/#{AppCodeVars.RepositoryName}/commit/#{AppCodeVars.CommitId}."
RunOrder: 3

- Name: Production
Expand Down Expand Up @@ -522,7 +523,7 @@ Resources:
Resource:
- !Sub 'arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${TestStackName}/*'
- !Sub 'arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${ProdStackName}/*'

DeploymentPermissions:
Type: AWS::IAM::ManagedPolicy
Properties:
Expand Down
3 changes: 2 additions & 1 deletion deploy/cloudformation/static-host-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ Resources:
Actions:
-
Name: "AppCode"
Namespace: "AppCodeVars"
ActionTypeId:
Owner: ThirdParty
Category: Source
Expand Down Expand Up @@ -616,7 +617,7 @@ Resources:
NotificationArn: !Ref ApprovalTopic
CustomData:
Fn::Sub:
- "A new version of https://github.com/${SourceRepoOwner}/${SourceRepoName} has been deployed to https://${TestHostname} and is awaiting your approval. If you approve these changes, they will be deployed to https://${ProdHostname}."
- "A new version of https://github.com/${SourceRepoOwner}/${SourceRepoName}/tree/#{AppCodeVars.BranchName} has been deployed to https://${TestHostname} and is awaiting your approval. If you approve these changes, they will be deployed to https://${ProdHostname}.\n\n*Commit Message*\n#{AppCodeVars.CommitMessage}\n\nFor more details on the changes, see https://github.com/${SourceRepoOwner}/#{AppCodeVars.RepositoryName}/commit/#{AppCodeVars.CommitId}."
- TestHostname:
Fn::ImportValue: !Join [':', [!Ref TestStackName, 'Hostname']]
ProdHostname:
Expand Down

0 comments on commit ee688fd

Please sign in to comment.