Git Product home page Git Product logo

buildkite-monorepo-example's Introduction

Buildkite Monorepo Example

Example monorepo using third-party buildkite tool buildpipe.

The monorepo config lives in buildpipe.yml. You can see there are 3 projects defined and deploy steps only happen during Eastern time business hours.

The config shows steps the projects share with their associated commands. The commands are standardized using make and Makefile inheritance.

Getting started

  1. Create a pipeline adding the following initial step
    buildpipe -i buildpipe.yml -o pipeline.yml
    buildkite-agent pipeline upload pipeline.yml
    Create pipeline
  2. Generate deploy key and change permissions
    # Start ssh agent in the background
    eval "$(ssh-agent -s)"
    
    # Generate ssh key
    make generate-deploy-ssh-key
    chmod 600 ~/.ssh/id_rsa_buildkite_git
    
    # Create agent socket
    ssh-agent -a ~/.ssh/ssh-agent.sock
    
    # Add ssh key
    ssh-add ~/.ssh/id_rsa_buildkite_git
    
    # Test key works
    # https://developer.github.com/v3/guides/using-ssh-agent-forwarding/
    ssh -T [email protected]
  3. Add the public key ~/.ssh/id_rsa_buildkite_git.pub to your Github repo under Settings > Deploy keys. Add deploy key
  4. Run the buildkite agents locally:
    # Make sure to add to .bashrc
    export SSH_AUTH_SOCK=$HOME/.ssh/ssh-agent.sock
    export BUILDKITE_AGENT_TOKEN=<token>
    
    # Run agent in a docker container scaled to the number of cpus
    cd buildkite-agent/ && make local

You should see the number of agents at the top bar in Buildkite appear.

Examples

The following examples shows how the pipeline creation is dynamic depending on which projects were changed.

  1. Updating primer project in master only triggers the primer pipeline to run Add deploy key
  2. Updating both primer and hubot projects in master triggers both pipelines Add deploy key

buildkite-monorepo-example's People

Contributors

ksindi avatar kbrinnehl-widen 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.