# Declare a Backstage Component that represents your application.
---
# yaml-language-server: $schema=https://json.schemastore.org/catalog-info.json
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: integrations
  description: Elastic Integrations
  links:
    - title: Elastic Integrations Documentation
      icon: file-doc
      url: https://www.elastic.co/integrations/
spec:
  type: library
  owner: group:ingest-fp
  system: platform-ingest
  lifecycle: production
  dependsOn:
    - "component:package-storage-infra"
    - "resource:pipeline-package-storage-infra-publishing"
    - "resource:buildkite-pipeline-unified-release-gpg-signing"

---
# 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-integrations
  description: 'Pipeline for the Integrations project'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations
      description: 'Pipeline for the Integrations project'
    spec:
      branch_configuration: "main backport-*"
      pipeline_file: ".buildkite/pipeline.yml"
      provider_settings:
        build_pull_request_forks: false
        build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main !backport-*'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main !backport-*'
      env:
        ELASTIC_PR_COMMENTS_ENABLED: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        ecosystem:
          access_level: MANAGE_BUILD_AND_READ
        observablt-ci:
          access_level: MANAGE_BUILD_AND_READ
        cloud-security-posture:
          access_level: BUILD_AND_READ
        customer-architects:
          access_level: BUILD_AND_READ
        elastic-agent:
          access_level: BUILD_AND_READ
        elastic-agent-data-plane:
          access_level: BUILD_AND_READ
        fleet:
          access_level: BUILD_AND_READ
        logstash:
          access_level: BUILD_AND_READ
        ml-ui:
          access_level: BUILD_AND_READ
        obs-ds-hosted-services:
          access_level: BUILD_AND_READ
        obs-ds-intake-services:
          access_level: BUILD_AND_READ
        obs-infraobs-integrations:
          access_level: BUILD_AND_READ
        obs-ux-management-team:
          access_level: BUILD_AND_READ
        profiling:
          access_level: BUILD_AND_READ
        protections:
          access_level: BUILD_AND_READ
        search-extract-and-transform:
          access_level: BUILD_AND_READ
        sec-applied-ml:
          access_level: BUILD_AND_READ
        sec-deployment-and-devices:
          access_level: BUILD_AND_READ
        sec-linux-platform:
          access_level: BUILD_AND_READ
        security-asset-management:
          access_level: BUILD_AND_READ
        security-service-integrations:
          access_level: BUILD_AND_READ
        sec-windows-platform:
          access_level: BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

---
# 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-integrations-test-stack
  description: 'Pipeline to test packages with a given Elastic stack version'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations-test-stack

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations-test-stack
      description: 'Pipeline to test packages with a given Elastic stack version'
    spec:
      branch_configuration: "main backport-*"
      pipeline_file: ".buildkite/pipeline.yml"
      provider_settings:
        build_pull_request_forks: false
        build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
        publish_commit_status: true
        build_tags: false
        build_branches: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main !backport-*'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main !backport-*'
      env:
        ELASTIC_PR_COMMENTS_ENABLED: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        observablt-ci:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: pipeline-integrations-schedule-daily
  description: 'Daily pipeline for the Integrations project'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations-schedule-daily

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations-schedule-daily
      description: 'Daily pipeline for the Integrations project'
    spec:
      pipeline_file: ".buildkite/pipeline.schedule-daily.yml"
      schedules:
        main_daily:
          branch: "main"
          cronline: "30 0 * * *"
          message: "Run the daily jobs"
          env:
            TEST_PACKAGES_7_BRANCH: "true"
            TEST_PACKAGES_SERVERLESS: "true"
            REPUBLISH_PACKAGES: "true"
        main_daily_8_version:
          branch: "main"
          cronline: "30 1 * * *"
          message: "Run the daily jobs for 8.x"
          env:
            TEST_PACKAGES_8_BRANCH: "true"
        main_daily_9_version:
          branch: "main"
          cronline: "30 3 * * *"
          message: "Run the daily jobs for 9.x"
          env:
            TEST_PACKAGES_9_BRANCH: "true"
        main_daily_basic_subscription:
          branch: "main"
          cronline: "30 4 * * *"
          message: "Run the daily jobs for basic subscription"
          env:
            TEST_PACKAGES_BASIC_SUBSCRIPTION: "true"
            
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
        build_pull_request_forks: false
        build_pull_requests: true
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main'
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#beats-build'
        SLACK_NOTIFICATIONS_ALL_BRANCHES: 'true'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        observablt-ci:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: pipeline-integrations-schedule-weekly
  description: 'Weekly pipeline for the Integrations project'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations-schedule-weekly

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations-schedule-weekly
      description: 'Weekly pipeline for the Integrations project'
    spec:
      pipeline_file: ".buildkite/pipeline.schedule-weekly.yml"
      schedules:
        main_weekly:
          branch: "main"
          cronline: "00 5 * * 1"
          message: "Run the weekly jobs"
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
        build_pull_request_forks: false
        build_pull_requests: true
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main'
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#ingest-notifications'
        SLACK_NOTIFICATIONS_ALL_BRANCHES: 'true'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        observablt-ci:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: pipeline-integrations-serverless
  description: 'Pipeline for the Integrations project in serverless'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations-serverless

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations-serverless
      description: 'Pipeline for the Integrations project in serverless'
    spec:
      pipeline_file: ".buildkite/pipeline.serverless.yml"
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
        build_pull_request_forks: false
        build_pull_requests: true
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        observablt-ci:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: pipeline-integrations-backport
  description: 'Pipeline to create backport branches in the Integrations project'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations-backport

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations-backport
      description: 'Pipeline to create backport branches in the Integrations project'
    spec:
      pipeline_file: ".buildkite/pipeline.backport.yml"
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
        build_pull_request_forks: false
        build_pull_requests: true
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: BUILD_AND_READ

---
# 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-integrations-publish
  description: 'Pipeline for the Integrations project to publish packages'
  links:
    - title: Pipeline
      url: https://buildkite.com/elastic/integrations-publish

spec:
  type: buildkite-pipeline
  owner: group:ingest-fp
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: integrations-publish
      description: 'Pipeline for the Integrations project to publish packages'
    spec:
      branch_configuration: "main backport-*"
      pipeline_file: ".buildkite/pipeline.publish.yml"
      provider_settings:
        build_pull_request_forks: false
        build_pull_requests: false # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api')
      repository: elastic/integrations
      cancel_intermediate_builds: true
      cancel_intermediate_builds_branch_filter: '!main !backport-*'
      skip_intermediate_builds: true
      skip_intermediate_builds_branch_filter: '!main !backport-*'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
