Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ steps:
limit: 1
- wait

- command: .buildkite/scripts/steps/store_cache.sh
label: Store Cache for build
timeout_in_minutes: 10
id: store_cache
soft_fail: true
depends_on:
- terrazzo-initial-pipeline-upload
agents:
Comment thread
delanni marked this conversation as resolved.
image: family/kibana-ubuntu-2404
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2
diskSizeGb: 95

- command: .buildkite/scripts/steps/on_merge_build_and_metrics.sh
label: Build Kibana Distribution
agents:
Expand Down
12 changes: 12 additions & 0 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10
id: pre_build
agents:
machineType: n2-standard-2
diskSizeGb: 100

- wait

- command: .buildkite/scripts/steps/store_cache.sh
label: Store Cache for build
timeout_in_minutes: 10
id: store_cache
soft_fail: true
depends_on:
- terrazzo-initial-pipeline-upload
agents:
machineType: n2-standard-2
diskSizeGb: 95

- command: .buildkite/scripts/steps/build_kibana.sh
label: Build Kibana Distribution
agents:
Expand Down
10 changes: 8 additions & 2 deletions .buildkite/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ if [[ "$(pwd)" != *"/local-ssd/"* && "$(pwd)" != "/dev/shm"* ]]; then
echo "Using ~/.kibana/.yarn-local-mirror as a starting point"
mv ~/.kibana/.yarn-local-mirror ./
fi
if [[ -d ~/.kibana-moon-cache ]]; then
# Check if there's a cache artifact uploaded from a previous step
if (buildkite-agent artifact download --step "store_cache" "moon-cache.tar.gz" ~/); then
echo "Found moon-cache.tar.gz artifact, extracting to ./.moon/cache"
mkdir -p ./.moon/cache
echo "Extracting moon-cache.tar.gz to ./.moon/cache"
tar -xzf ~/moon-cache.tar.gz -C ./
elif [[ -d ~/.kibana-moon-cache ]]; then
echo "Using ~/.moon/cache as a starting point"
mkdir -p ./.moon/cache
mv ~/.kibana-moon-cache ./.moon/cache
mv ~/.kibana-moon-cache/* ./.moon/cache
fi
fi

Expand Down
18 changes: 18 additions & 0 deletions .buildkite/scripts/steps/store_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

export MOON_CACHE=write
.buildkite/scripts/bootstrap.sh
echo "--- Archive moon cache"
if [[ ! -d .moon/cache ]]; then
echo "No moon cache directory found, skipping archive"
exit 0
else
tar -czf ~/moon-cache.tar.gz .moon/cache || echo "Failed to archive moon cache"
cd ~/
buildkite-agent artifact upload moon-cache.tar.gz || echo "Failed to upload moon cache"
echo "Moon cache archived as moon-cache.tar.gz"
fi