From ddb3e209b4e62bffaf4c63647cd9c2752f47a0df Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Mon, 19 Jun 2023 10:01:55 +0200 Subject: [PATCH] Onboard repository in Buildkite (#299) (cherry picked from commit ff035455b0e3c7bb427333d71618f385d8890efe) --- .buildkite/pipeline.yml | 5 +++ .buildkite/pull-requests.json | 20 ++++++++++++ catalog-info.yaml | 58 +++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 .buildkite/pipeline.yml create mode 100644 .buildkite/pull-requests.json create mode 100644 catalog-info.yaml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 00000000..34321b61 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json + +steps: + - label: "Example test" + command: echo "Hello!" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json new file mode 100644 index 00000000..008fd4e3 --- /dev/null +++ b/.buildkite/pull-requests.json @@ -0,0 +1,20 @@ +{ + "jobs": [ + { + "enabled": true, + "pipelineSlug": "golang-crossbuild", + "allow_org_users": true, + "allowed_repo_permissions": ["admin", "write"], + "allowed_list": [ ], + "set_commit_status": true, + "build_on_commit": true, + "build_on_comment": true, + "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", + "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", + "skip_ci_labels": [ ], + "skip_target_branches": [ ], + "skip_ci_on_only_changed": [ ], + "always_require_ci_on_changed": [ ] + } + ] +} diff --git a/catalog-info.yaml b/catalog-info.yaml new file mode 100644 index 00000000..6635c8a3 --- /dev/null +++ b/catalog-info.yaml @@ -0,0 +1,58 @@ +# 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: golang-crossbuild + +spec: + type: tool + owner: group:ingest-fp + system: platform-ingest + lifecycle: production + +--- +# 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-golang-crossbuild + description: 'Pipeline for the golang-crossbuild project' + links: + - title: Pipeline + url: https://buildkite.com/elastic/golang-crossbuild + +spec: + type: buildkite-pipeline + owner: group:ingest-fp + system: buildkite + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: golang-crossbuild + description: 'Pipeline for the golang-crossbuild project' + spec: + branch_configuration: "main v1.*" + 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: true + filter_enabled: true + filter_condition: >- + build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) + repository: elastic/golang-crossbuild + cancel_intermediate_builds: true + cancel_intermediate_builds_branch_filter: '!main' + skip_intermediate_builds: true + skip_intermediate_builds_branch_filter: '!main' + # TODO uncomment this environment variable when pipeline definition is updated + # env: + # ELASTIC_PR_COMMENTS_ENABLED: 'true' + teams: + ingest-fp: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY