Metadata-Version: 2.1
Name: aws-cdk-build-badge
Version: 0.0.4
Summary: aws-cdk-build-badge
Home-page: https://github.com/mmuller88/aws-cdk-build-badge
Author: martin.mueller<damadden88@googlemail.de>
License: Apache-2.0
Project-URL: Source, https://github.com/mmuller88/aws-cdk-build-badge
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Typing :: Typed
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: aws-cdk.aws-apigateway (==1.83.0)
Requires-Dist: aws-cdk.aws-iam (==1.83.0)
Requires-Dist: aws-cdk.aws-lambda-nodejs (==1.83.0)
Requires-Dist: aws-cdk.aws-lambda (==1.83.0)
Requires-Dist: aws-cdk.core (==1.83.0)
Requires-Dist: constructs (<4.0.0,>=3.2.27)
Requires-Dist: jsii (<2.0.0,>=1.16.0)
Requires-Dist: publication (>=0.0.3)

[![NPM version](https://badge.fury.io/js/aws-cdk-build-badge.svg)](https://badge.fury.io/js/aws-cdk-build-badge)
[![PyPI version](https://badge.fury.io/py/aws-cdk-build-badge.svg)](https://badge.fury.io/py/aws-cdk-build-badge)
[![.NET version](https://img.shields.io/nuget/v/com.github.mmuller88.awsCdkBuildBadge.svg?style=flat-square)](https://www.nuget.org/packages/com.github.mmuller88.awsCdkBuildBadge/)
![Release](https://github.com/mmuller88/aws-cdk-build-badge/workflows/Release/badge.svg)

# aws-cdk-build-badge

This an AWS CDK custom construct for get the status of a CodeBuild Project with has CodePipeline as source. That is currently not possible:

* https://github.com/aws/aws-cdk/issues/1749

How the native badges are working you find in the AWS docs:

* https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-badges.html

After you created the build badge construct you can use the api gateway url to get the badge picture. Additionally you can retrieve the url to to the CodeBuild build with adding ?url=true to the query parameter. See the example.

# Example

Build succeeded: [![CodeBuild test build](https://fktijpwdng.execute-api.eu-central-1.amazonaws.com/prod/?projectName=PipelineCustomStageprodTest-Fdei5bm2ulR6)](https://fktijpwdng.execute-api.eu-central-1.amazonaws.com/prod/?projectName=PipelineCustomStageprodTest-Fdei5bm2ulR6&url=true)

Build failed: [![CodeBuild test build](https://fktijpwdng.execute-api.eu-central-1.amazonaws.com/prod/?projectName=PipelineCustomStagedevTestC-UnzKxyLsGYZw)](https://fktijpwdng.execute-api.eu-central-1.amazonaws.com/prod/?projectName=PipelineCustomStageprodTest-Fdei5bm2ulR6&url=true)

Build not found: [![CodeBuild test build](https://fktijpwdng.execute-api.eu-central-1.amazonaws.com/prod/?projectName=123)](https://fktijpwdng.execute-api.eu-central-1.amazonaws.com/prod/?projectName=123&url=true)

There are more badges (see ./badges/) but I don't have build in that state atm.

```python
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
app = cdk.App()

stack = cdk.Stack(app, "my-build-badge-demo-stack")

# without exposing the account id in the url when using ?url=true
BuildBadge(stack, "BuildBadge")

# with exposing the account id in the url when using ?url=true
BuildBadge(stack, "BuildBadge2", hide_account_iD="no")

# partly exposing the account id in the url when using ?url=true
BuildBadge(stack, "BuildBadge3", hide_account_iD="XX123356")
```

# Thanks To

* The CDK Community cdk-dev.slack.com
* [Projen](https://github.com/projen/projen) project and the community around it
* https://github.com/btorun/aws-codebuild-badges


