Coder Social home page Coder Social logo

cdk-constructs's Introduction

Library of CDK constructs

  • Pull Request Validator (based on AWS blog)

How to build with Poetry

To build a new version:

  1. make sure that any dependencies have been added to poetry with:
poetry add <package_name>
  1. Bump the version number in pyproject.toml

  2. Run

poetry build
  1. Your .whl package is located in /dist

How to Use

When you have a build, you can install the package with:

pip install cdk_constructs-0.2.0-py3-none-any.whl

Now you can use the object PullRequestValidator() in your CDK app by importing the module in the CDK stack and constructing the object.

from aws_cdk import core
from cdk_constructs.validate_pull_requests import PullRequestValidator


class AppStack(core.Stack):

    def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)

        # The code that defines your stack goes here

        PullRequestValidator(
            self, "PRValidator",
            repo_name="repository-name",
            buildspec_file="deploy/buildspec.yaml")

The buildspec.yaml file will include what you want to have run to validate if the PR is adhering to your standards.

Example buildspec.yaml:

version: 0.2
  phases:
    install:
      commands:
        - pip install pre-commit
        - pre-commit install
    build:
      commands:
        - pre-commit run --all-files
artifacts:
  files:
    - *

cdk-constructs's People

Watchers

James Cloos avatar Yvonne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.