From b81b9f8f6a19df79c8c61982c36f9f1e56e4f8cd Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Mon, 4 Apr 2022 13:24:25 -0500 Subject: [PATCH 1/3] [artifacts] Merge docker context verification --- .../scripts/steps/artifacts/docker_context.sh | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .buildkite/scripts/steps/artifacts/docker_context.sh diff --git a/.buildkite/scripts/steps/artifacts/docker_context.sh b/.buildkite/scripts/steps/artifacts/docker_context.sh new file mode 100644 index 0000000000000..5147a9ed2ea27 --- /dev/null +++ b/.buildkite/scripts/steps/artifacts/docker_context.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh + +if [[ "${RELEASE_BUILD:-}" == "true" ]]; then + VERSION="$(jq -r '.version' package.json)" + RELEASE_ARG="--release" +else + VERSION="$(jq -r '.version' package.json)-SNAPSHOT" + RELEASE_ARG="" +fi + +echo "--- Create Kibana Docker contexts" +mkdir -p target +node scripts/build "$RELEASE_ARG" --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact + +echo "--- Build default context" +DOCKER_BUILD_FOLDER=$(mktemp -d) + +tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER" +cd $DOCKER_BUILD_FOLDER + +buildkite-agent artifact download "kibana-$VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + +docker build . From a11bd7dc6f850d5d0c432fb6b63d036474a159f7 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Mon, 4 Apr 2022 13:49:18 -0500 Subject: [PATCH 2/3] add to pipeline --- .buildkite/pipelines/artifacts.yml | 6 ++++++ .buildkite/scripts/steps/artifacts/docker_context.sh | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipelines/artifacts.yml b/.buildkite/pipelines/artifacts.yml index e934b01d8a4d9..2b6c716c66830 100644 --- a/.buildkite/pipelines/artifacts.yml +++ b/.buildkite/pipelines/artifacts.yml @@ -24,3 +24,9 @@ steps: agents: queue: n2-4-virt timeout_in_minutes: 20 + + - command: .buildkite/scripts/steps/artifacts/docker_context.sh + label: 'Docker Build Context' + agents: + queue: n2-4 + timeout_in_minutes: 20 diff --git a/.buildkite/scripts/steps/artifacts/docker_context.sh b/.buildkite/scripts/steps/artifacts/docker_context.sh index 5147a9ed2ea27..787f5d278febc 100644 --- a/.buildkite/scripts/steps/artifacts/docker_context.sh +++ b/.buildkite/scripts/steps/artifacts/docker_context.sh @@ -12,11 +12,11 @@ else RELEASE_ARG="" fi -echo "--- Create Kibana Docker contexts" +echo "--- Create contexts" mkdir -p target node scripts/build "$RELEASE_ARG" --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact -echo "--- Build default context" +echo "--- Setup default context" DOCKER_BUILD_FOLDER=$(mktemp -d) tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER" @@ -24,4 +24,5 @@ cd $DOCKER_BUILD_FOLDER buildkite-agent artifact download "kibana-$VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +echo "--- Build context" docker build . From 47cc07d0d152fdf684d44f76633edfb5ebb58c9c Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Mon, 4 Apr 2022 14:46:29 -0500 Subject: [PATCH 3/3] n2-2 --- .buildkite/pipelines/artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipelines/artifacts.yml b/.buildkite/pipelines/artifacts.yml index 2b6c716c66830..773672c5f05f5 100644 --- a/.buildkite/pipelines/artifacts.yml +++ b/.buildkite/pipelines/artifacts.yml @@ -28,5 +28,5 @@ steps: - command: .buildkite/scripts/steps/artifacts/docker_context.sh label: 'Docker Build Context' agents: - queue: n2-4 + queue: n2-2 timeout_in_minutes: 20