mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[ci] Implement package registry promotion pipeline (#199071)
This adds a daily build that runs tests again `docker.elastic.co/package-registry/distribution:lite` and if successful, promotes the image to `docker.elastic.co/kibana-ci/package-registry-distribution:lite`. A follow up pull request will swap integration tests over to use the promoted image, and add environment overrides to run tests against the source image in this pipeline. https://buildkite.com/elastic/kibana-package-registry-promote/builds/2
This commit is contained in:
parent
f349f61cbc
commit
652da174b6
3 changed files with 99 additions and 6 deletions
|
@ -2,10 +2,10 @@
|
|||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Resource
|
||||
metadata:
|
||||
name: bk-kibana-package-registry-promote
|
||||
name: bk-kibana-package-registry-verify-and-promote
|
||||
description: Promote package-registry/distribution:lite
|
||||
links:
|
||||
- url: 'https://buildkite.com/elastic/kibana-package-registry-promote'
|
||||
- url: 'https://buildkite.com/elastic/kibana-package-registry-verify-and-promote'
|
||||
title: Pipeline link
|
||||
spec:
|
||||
type: buildkite-pipeline
|
||||
|
@ -15,18 +15,21 @@ spec:
|
|||
apiVersion: buildkite.elastic.dev/v1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: kibana / package registry promote
|
||||
description: Promote package-registry/distribution:lite
|
||||
name: kibana / package registry verify and promote
|
||||
description: Verify and promote docker.elastic.co/package-registry/distribution:lite
|
||||
spec:
|
||||
env:
|
||||
SLACK_NOTIFICATIONS_CHANNEL: "#kibana-operations-alerts"
|
||||
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "false"
|
||||
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "true"
|
||||
repository: elastic/kibana
|
||||
branch_configuration: main
|
||||
default_branch: main
|
||||
pipeline_file: ".buildkite/pipelines/fleet/package_registry.yml"
|
||||
provider_settings:
|
||||
trigger_mode: none
|
||||
schedules:
|
||||
Daily promotion:
|
||||
cronline: 0 22 * * * America/New_York
|
||||
teams:
|
||||
everyone:
|
||||
access_level: BUILD_AND_READ
|
||||
|
|
|
@ -1,2 +1,70 @@
|
|||
env:
|
||||
IGNORE_SHIP_CI_STATS_ERROR: 'true'
|
||||
steps:
|
||||
- command: echo "Placeholder"
|
||||
- command: .buildkite/scripts/lifecycle/pre_build.sh
|
||||
label: Pre-Build
|
||||
timeout_in_minutes: 10
|
||||
agents:
|
||||
image: family/kibana-ubuntu-2004
|
||||
imageProject: elastic-images-prod
|
||||
provider: gcp
|
||||
machineType: n2-standard-2
|
||||
|
||||
- wait
|
||||
|
||||
- command: .buildkite/scripts/steps/build_kibana.sh
|
||||
label: Build Kibana Distribution
|
||||
agents:
|
||||
image: family/kibana-ubuntu-2004
|
||||
imageProject: elastic-images-prod
|
||||
provider: gcp
|
||||
machineType: n2-standard-8
|
||||
preemptible: true
|
||||
key: build
|
||||
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
|
||||
timeout_in_minutes: 60
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '-1'
|
||||
limit: 3
|
||||
|
||||
- command: .buildkite/scripts/steps/test/pick_test_group_run_order.sh
|
||||
label: 'Pick Test Group Run Order'
|
||||
agents:
|
||||
image: family/kibana-ubuntu-2004
|
||||
imageProject: elastic-images-prod
|
||||
provider: gcp
|
||||
machineType: n2-standard-2
|
||||
timeout_in_minutes: 10
|
||||
env:
|
||||
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/test/jest.sh'
|
||||
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/test/jest_integration.sh'
|
||||
FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/ftr_configs.sh'
|
||||
LIMIT_CONFIG_TYPE: integration,functional
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: .buildkite/scripts/steps/fleet/promote_package_registry.sh
|
||||
label: Promote docker.elastic.co/package-registry/distribution:lite
|
||||
agents:
|
||||
image: family/kibana-ubuntu-2004
|
||||
imageProject: elastic-images-prod
|
||||
provider: gcp
|
||||
machineType: n2-standard-2
|
||||
depends_on:
|
||||
- ftr-configs
|
||||
- jest-integration
|
||||
|
||||
- wait: ~
|
||||
continue_on_failure: true
|
||||
|
||||
- command: .buildkite/scripts/lifecycle/post_build.sh
|
||||
label: Post-Build
|
||||
timeout_in_minutes: 10
|
||||
agents:
|
||||
image: family/kibana-ubuntu-2004
|
||||
imageProject: elastic-images-prod
|
||||
provider: gcp
|
||||
machineType: n2-standard-2
|
||||
|
|
22
.buildkite/scripts/steps/fleet/promote_package_registry.sh
Executable file
22
.buildkite/scripts/steps/fleet/promote_package_registry.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PACKAGE_REGISTRY_BASE_IMAGE='docker.elastic.co/package-registry/distribution:lite'
|
||||
PACKAGE_REGISTRY_TARGET_IMAGE='docker.elastic.co/kibana-ci/package-registry-distribution:lite'
|
||||
|
||||
if [[ "$BUILDKITE_BRANCH" == "main" ]]; then
|
||||
docker buildx imagetools create -t "$PACKAGE_REGISTRY_TARGET_IMAGE" "$PACKAGE_REGISTRY_BASE_IMAGE"
|
||||
cat << EOF | buildkite-agent pipeline upload
|
||||
steps:
|
||||
- label: "Update cache for EPR image"
|
||||
trigger: kibana-vm-images
|
||||
async: true
|
||||
build:
|
||||
env:
|
||||
IMAGES_CONFIG="kibana/images.yml"
|
||||
RETRY="1"
|
||||
EOF
|
||||
else
|
||||
echo "Skipping promotion for untracked branch $BUILDKITE_BRANCH"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue