# Component
---
# yaml-language-server: $schema=https://json.schemastore.org/catalog-info.json
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: elasticsearch-k8s-metrics-adapter
  description: An implementation of the Kubernetes Custom Metrics API for Elasticsearch
  annotations:
    backstage.io/source-location: "url:https://github.com/elastic/elasticsearch-k8s-metrics-adapter/"
    github.com/project-slug: elastic/elasticsearch-k8s-metrics-adapter
    buildkite.com/project-slug: elastic/elasticsearch-k8s-metrics-adapter
    sonarqube.org/project-key: elasticsearch-k8s-metrics-adapter
    pagerduty.com/service-id: PA1IPRT
  tags:
    - serverless
    - regional
    - application
spec:
  type: service
  owner: group:serverless-applications
  lifecycle: experimental
  system: control-plane

# Buildkite pipeline
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: buildkite-pipeline-elasticsearch-k8s-metrics-adapter
  description: Buildkite Pipeline for elasticsearch-k8s-metrics-adapter
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/elasticsearch-k8s-metrics-adapter
spec:
  type: buildkite-pipeline
  owner: group:serverless-applications
  system: buildkite
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: elasticsearch-k8s-metrics-adapter
    spec:
      repository: elastic/elasticsearch-k8s-metrics-adapter
      provider_settings:
        build_branches: true
        build_pull_request_ready_for_review: true
        build_tags: true
        publish_blocked_as_pending: true
        publish_commit_status: true
        publish_commit_status_per_step: false
        skip_pull_request_builds_for_existing_commits: false
      teams:
        serverless-applications:
          access_level: MANAGE_BUILD_AND_READ
        cloud-tooling:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# Quality gates pipeline
---
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: elasticsearch-k8s-metrics-adapter-tests-pipeline
  description: Definition of the lelasticsearch-k8s-metrics-adapter-tests pipeline
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/elasticsearch-k8s-metrics-adapter-tests
spec:
  type: buildkite-pipeline
  owner: group:serverless-applications
  system: buildkite
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: elasticsearch-k8s-metrics-adapter-tests
      description: Pipeline that tests the service integration in various environments
    spec:
      repository: elastic/elasticsearch-k8s-metrics-adapter
      pipeline_file: ./.buildkite/pipeline.elasticsearch-k8s-metrics-adapter-tests.yaml
      skip_intermediate_builds: false
      provider_settings:
        trigger_mode: none
      teams:
        serverless-applications:
          access_level: MANAGE_BUILD_AND_READ
        cloud-tooling:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
