Aws-cdk: Integrating AWS CodePipeline with the GitHub Commit Status API

Created on 17 Jun 2019  路  8Comments  路  Source: aws/aws-cdk

I have a business requirement to display commit status' in our full github development workflow

This requires CodePipeline to be set up with the Github Status API https://github.blog/2012-09-04-commit-status-api/

Here is an example of implementing this with AWS CodePipeline, Amazon CloudWatch and AWS Lambda:
https://scratchpad.blog/2019/03/16/integrating-aws-codepipeline-with-the-github-commit-status-api.html

It would be even better to set this up through CDK!

Thanks :)

@aws-cdaws-codepipeline efforlarge feature-request p2

Most helpful comment

I'm sorry this isn't a PR but maybe you can use this. I'm using it in my pipeline and it works.

Github Stage Status Construct: https://gist.github.com/jewelsjacobs/a0b627f3b9a176fbbb0d98f8ff7b1fea

Github Status API Lambda:
https://gist.github.com/jewelsjacobs/8a27147afbb265cbb1c1dd6782c2de44

How the construct works in a pipeline stack(I'm using it on a build stage but it can be easily used in a multistage iteration type scenario):

https://gist.github.com/jewelsjacobs/7262100a2f45e6b68659b70edacc64cf#file-pipeline-stack-ts-L162-L165

Screenshots:

Screen Shot 2019-08-15 at 3 10 26 PM

Screen Shot 2019-08-15 at 3 00 25 PM

Screen Shot 2019-08-15 at 3 02 56 PM

All 8 comments

Like I said before in our Gitter channel, this issue is about CodePipeline; the CodeBuild integration is automatic, described here: https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/aws-codebuild/README.md#githubsource-and-githubenterprisesource

I'm sorry this isn't a PR but maybe you can use this. I'm using it in my pipeline and it works.

Github Stage Status Construct: https://gist.github.com/jewelsjacobs/a0b627f3b9a176fbbb0d98f8ff7b1fea

Github Status API Lambda:
https://gist.github.com/jewelsjacobs/8a27147afbb265cbb1c1dd6782c2de44

How the construct works in a pipeline stack(I'm using it on a build stage but it can be easily used in a multistage iteration type scenario):

https://gist.github.com/jewelsjacobs/7262100a2f45e6b68659b70edacc64cf#file-pipeline-stack-ts-L162-L165

Screenshots:

Screen Shot 2019-08-15 at 3 10 26 PM

Screen Shot 2019-08-15 at 3 00 25 PM

Screen Shot 2019-08-15 at 3 02 56 PM

@skinny85 I'm going to attempt to create a PR for this. Stay tuned ....

I'm sorry but I don't have off hours time to contribute this 馃槮

@jewelsjacobs thanks so much for putting this together! just used the code you linked in your comment after stumbling through this myself for several hours and worked like a charm. any news on when this might get integrated directly into CDK?

@jewelsjacobs, would you mind if I use your code as a starting point for a PR to get this into aws-cdk?

@skinny85 Is a lambda like this an acceptable addition? I'm unaware of any other instances in aws-cdk where a lambda is used to extend base functionality of a resource. If you think this would work and know of any other examples, I'd like to make sure we have consistency between additions of this type.

@skinny85 Is a lambda like this an acceptable addition? I'm unaware of any other instances in aws-cdk where a lambda is used to extend base functionality of a resource. If you think this would work and know of any other examples, I'd like to make sure we have consistency between additions of this type.

Absolutely 馃檪. There are many places in the CDK where we use Lambda-backed CloudFormation custom resources to add some functionality not available otherwise:

Good luck!

Was this page helpful?
0 / 5 - 0 ratings