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

Support multiple steps when matching a path #30

Open
jamietanna opened this issue Oct 7, 2024 · 2 comments
Open

Support multiple steps when matching a path #30

jamietanna opened this issue Oct 7, 2024 · 2 comments

Comments

@jamietanna
Copy link

Right now, the monorepo-diff plugin only makes it possible to perform a single step when matching a given path.

For instance, let's take the following snippet:

# .buildkite/pipeline.yml
steps:
  - label: "Triggering pipelines"
    plugins:
      - monorepo-diff#v1.0.1:
          diff: "git diff --name-only HEAD~1"
          watch:
            # ...
            - path: test/bin/
              config:
                command: "echo Make Changes to Bin"
                # alternatively `commands` for a multi-line, but still single-step build
            # ...

We can see that we can only run one command/one set of commands here, which means we can't perform a multi-step build.

Therefore what we find is that we need to produce a separate pipeline for this, and make the following changes:

# .buildkite/pipeline.yml
steps:
  - label: "Triggering pipelines"
    plugins:
      - monorepo-diff#v1.0.1:
          diff: "git diff --name-only HEAD~1"
          watch:
			# ...
            - path: test/bin/
              config:
-               command: "echo Make Changes to Bin"
+               label: ":pipeline: Upload Pipeline for Bin"
+               command: "buildkite-agent pipeline upload .buildkite/test-bin.yml"
			# ...

Then we would have the following separate pipeline file:

# .buildkite/test-bin.yml
steps:
  - label: "Do something"
    commands:
    - echo "..."
  - label: "Do something else"
    commands:
    - echo "..."
  # ...

This may be intentional, as a way to ensure that pipelines in the monolithic pipeline build is simplified, but sometimes it can be useful to set up a multi-step pipeline without the overhead of a new file that needs to be managed.

It'd be good to understand if it's intentional - if so we can tweak the docs - or if not, it'd be appreciated if we could instead provide multiple steps.

@mcncl
Copy link

mcncl commented Oct 8, 2024

@jamietanna thanks for raising this. Is your hope here then that the config can, in theory, accept a pipeline YAML as it's value?

@wandergeek
Copy link

@mcncl yes, I believe that would be the intent. I also would like to see this being implemented. :)

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