# Declare your Buildkite pipelines below
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: buildkite-pipeline-elastic-crawler
  description: Buildkite Pipeline for Elastic Open Web Crawler
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/elastic-crawler

# ------------------------------------------------------------------------------
# this is the main pipeline, triggered via pull requests and merges

spec:
  type: buildkite-pipeline
  owner: group:search-eng
  system: buildkite
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: elastic-crawler
      description:
    spec:
      branch_configuration: "main"
      repository: elastic/crawler
      pipeline_file: ".buildkite/pipeline.yml"
      provider_settings:
        skip_pull_request_builds_for_existing_commits: false
      teams:
        search-extract-and-transform:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
        search-productivity-team: {}

---
# ------------------------------------------------------------------------------
# docker image build and publish - manual release

apiVersion: "backstage.io/v1alpha1"
kind: "Resource"
metadata:
  name: "crawler-docker-build-publish"
  description: "Docker image build and publish for Elastic crawler"
  links:
    - title: "Crawler Docker Build and Publish"
      url: "https://buildkite.com/elastic/crawler-docker-build-publish"
spec:
  type: "buildkite-pipeline"
  owner: "group:search-extract-and-transform"
  system: "buildkite"
  implementation:
    apiVersion: "buildkite.elastic.dev/v1"
    kind: "Pipeline"
    metadata:
      name: "crawler-docker-build-publish"
    spec:
      repository: "elastic/crawler"
      pipeline_file: ".buildkite/release-pipeline.yml"
      provider_settings:
        trigger_mode: "none"
      teams:
        search-extract-and-transform: {}
        search-productivity-team: {}
        everyone:
          access_level: "READ_ONLY"
