Git Product home page Git Product logo

codebuild-local's Introduction

Codebuild Local

codebuild-local is a simple script for running AWS CodeBuild projects locally by using its buildspec.yaml file format.

How it works

Basically, codebuild-local takes a given buildspec.yaml and converts the definition into a dockerfile. Afterwards, a docker container is built and the build specification is executed within the container.

Getting Started

To install the script

git clone https://github.com/teekaay/codebuild-local.git
cd codebuild-local
pip install -e .

To run a code build specificiation (using the demo codebuild.yaml from the project)

codebuild-local --rm

For all available options, run codebuild-local --help.

Usage

usage: codebuild-local [-h] [--docker-image DOCKER_IMAGE]
                    [--dockerfile DOCKERFILE] [--buildspec BUILDSPEC]
                    [--context-dir CONTEXT_DIR] [--project PROJECT] [--rm]
                    [--verbose]

Run buildspec yaml files locally in docker

optional arguments:
-h, --help            show this help message and exit
--docker-image DOCKER_IMAGE
                        Name of the docker image to use. Defaults to debian
--dockerfile DOCKERFILE
                        Path to the generated Dockerfile. If not specified,
                        the Dockerfile will be printed to stdout
--buildspec BUILDSPEC
                        Path to buildspec file. Defaults to buildspec.yaml
--context-dir CONTEXT_DIR
                        Docker context directory. Defaults to current working
                        directory
--project PROJECT     Name of the project. If not provided a random UUID
                        will be generated
--rm                  If set, intermediate files will be cleaned up
--verbose             Enable verbose logging

Further Notes

Using AWS SSM

If you want to use AWS for retrieving parameters from the parameter store, you can do this by using the env propery

env:
    variables: {}
    parameter-store: 
        key1: "value1"
        key2: "value2"

Here, the two SSM parameters value1 and value2 will be retrieved from SSM and be set as

ENV key1=<value-of-ssm-param-value2>
ENV key2=<value-of-ssm-param-value2>

Note that you need to have a valid AWS session token.

codebuild-local's People

Contributors

thomasklinger1234 avatar

Stargazers

 avatar

Watchers

 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.