https://github.com/ksindi/buildkite-monorepo-example
:ship: Example monorepo using Buildkite and buildpipe plugin
https://github.com/ksindi/buildkite-monorepo-example
buildkite cicd devops devops-tools example monorepo
Last synced: 2 months ago
JSON representation
:ship: Example monorepo using Buildkite and buildpipe plugin
- Host: GitHub
- URL: https://github.com/ksindi/buildkite-monorepo-example
- Owner: ksindi
- License: mit
- Created: 2018-05-16T12:36:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T23:43:42.000Z (about 1 year ago)
- Last Synced: 2025-02-18T12:15:22.148Z (3 months ago)
- Topics: buildkite, cicd, devops, devops-tools, example, monorepo
- Language: Makefile
- Homepage:
- Size: 451 KB
- Stars: 14
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Buildkite Monorepo Example
Example monorepo using buildkite plugin [buildpipe](https://github.com/jwplayer/buildpipe-buildkite-plugin/).
The monorepo config lives in [.buildkite/pipeline.yml](./.buildkite/pipeline.yml).
You can see there are 3 projects defined.The config shows steps the projects share with their associated commands. The commands are standardized using `make` and Makefile inheritance.
## Getting started
1. Create the initial pipeline:
```yaml
steps:
- label: ":buildkite:"
plugins:
- jwplayer/buildpipe#v0.9.1:
dynamic_pipeline: .buildkite/dynamic_pipeline.yml
```
1. Generate deploy key and change permissions
```bash
# 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]
```
1. Add the public key `~/.ssh/id_rsa_buildkite_git.pub` to your Github repo under Settings > Deploy keys.

1. Run the buildkite agents locally:
```bash
# Make sure to add to .bashrc
export SSH_AUTH_SOCK=$HOME/.ssh/ssh-agent.sock
export BUILDKITE_AGENT_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

1. Updating both primer and hubot projects in master triggers both pipelines
