---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: endpoint-package-pipeline
  description: Buildkite Pipeline for endpoint-package
  links:
    - title: Endpoint Package Pipeline
      url: https://buildkite.com/elastic/endpoint-package

spec:
  type: buildkite-pipeline
  owner: group:security-defend-workflows
  system: buildkite
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: endpoint-package
    spec:
      repository: elastic/endpoint-package
      pipeline_file: ".buildkite/pipeline.yml.py"
      # branch_configuration must be a space separated list of branches
      # to build automatically.
      branch_configuration: main 8.12 8.13 8.14 8.15 8.16 8.17 8.18 8.x 9.0
      cancel_intermediate_builds: true
      # Do not accidently skip main or release branch that may be in the middle of releasing
      cancel_intermediate_builds_branch_filter: '!main !8.12 !8.13 !8.14 !8.15 !8.16 !8.17 !8.18 !8.x !9.0'
      skip_intermediate_builds: true
      # Do not accidently skip main or release branch that may be in the middle of releasing
      skip_intermediate_builds_branch_filter: '!main !8.12 !8.13 !8.14 !8.15 !8.16 !8.17 !8.18 !8.x !9.0'
      provider_settings:
        build_pull_request_forks: false
        build_pull_request_labels_changed: false
        build_pull_requests: true
        build_tags: false
        cancel_deleted_branch_builds: true
        skip_builds_for_existing_commits: true
        skip_pull_request_builds_for_existing_commits: true
      teams:
        endpoint-ci-admin: {}
        security-defend-workflows:
          access_level: BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
