Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining dependencies between projects? #72

Open
evandam opened this issue Oct 13, 2020 · 4 comments
Open

Defining dependencies between projects? #72

evandam opened this issue Oct 13, 2020 · 4 comments

Comments

@evandam
Copy link

evandam commented Oct 13, 2020

Hey there 👋

This looks like an awesome project but I was hoping to get some clarification.

You mention "Especially useful for monorepos where you want to create dependencies between projects." Is there an example that shows how to define dependencies between projects? I can't find docs around this anywhere.

If it helps, here's the use case I have in mind. I'm looking to do Packer builds, where if I change the base image, I want to trigger all subsequent builds:

Ex:

└── packer
    ├── golang
    ├── node
    ├── python
    ├── ruby
    └── ubuntu

I would like the language-specific images to have a dependency on the ubuntu build, so if I update the base image, all the others will be updated.

Similarly, I might want to do something like run tests on all projects in the monorepo if a shared library changes.

@ksindi
Copy link
Contributor

ksindi commented Oct 21, 2020

Hi @evandam! Check out https://github.com/ksindi/buildkite-monorepo-example for a working example.

@ksindi
Copy link
Contributor

ksindi commented Oct 21, 2020

You can definitely set ubuntu as a dependency for the other projects by adding it to their paths.

@bradbarrow
Copy link
Contributor

Hi friends,

I trust there's no way to be more granular about this dependency on a per step basis?

e.g. In this example, app depends on some packages

root/
  app/
  packages/

Tests
My app depends on packages so I want to run tests on both when packages change.

Linting
Changing packages doesn't affect the source code of app so I don't want to lint app

--

The current config method for defining buildpipe dependencies is the paths:

projects:
  - label: App
    path:
      - root/app
      - root/packages
  - label: Packages
    path: root/packages

steps:
  - label: 'Test'
    env:
      BUILDPIPE_SCOPE: project
    command:
      - cd $$BUILDPIPE_PROJECT_PATH
      - yarn run test
  - label: 'Lint'
    env:
      BUILDPIPE_SCOPE: project
    command:
      - cd $$BUILDPIPE_PROJECT_PATH
      - yarn run lint

But in this case, changing code in packages will cause app to be linted.

@ksindi
Copy link
Contributor

ksindi commented Jul 29, 2021

@bradbarrow unfortunately there's no easy way. The most you can probably do is have custom logic on the step that inspects environment variables set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants