adikari / monorepo-diff-buildkite-plugin

Run separate pipelines for each folder in your monorepo
MIT License
202 stars 78 forks source link

Add common path in config #100

Open yindia opened 2 years ago

yindia commented 2 years ago

Let's say we have a few common paths like gen files, lib/package, and other dependencies. In the current setup, we need to add them to all the services but if we have a common config then we just need to add it at one place

example

steps:
  - label: "Triggering pipelines"
    plugins:
      - chronotc/monorepo-diff#v2.3.0:
          diff: "git diff --name-only $(head -n 1 last_successful_build)"
          interpolation: false
          env:
            - env1=env-1 # this will be appended to all env configuration
          hooks:
            - command: "echo $(git rev-parse HEAD) > last_successful_build"
          common:
                - "gen/"
                - "api/"
          watch:
            - path:
                - "ops/terraform/"
                - "ops/templates/terraform/"
              config:
                command: "buildkite-agent pipeline upload ops/.buildkite/pipeline.yml"
                label: "Upload pipeline"
                retry:
                  automatic:
                  - limit: 2
                    exit_status: -1
                agents:
                  queue: performance
                artifacts:
                  - "logs/*"
                env:
                  - FOO=bar
            - path: 
                - "foo-service/"
              config:
                trigger: "deploy-foo-service"
                label: "Triggered deploy"
                build:
                  message: "Deploying foo service"
                  env:
                    - HELLO=123
                    - AWS_REGION
          wait: true
adikari commented 1 year ago

@evalsocket I kind of understand your proposal here but would be more helpful if you elaborate more on the use case that you have. We can then explore how we could resolve the issue.