Skip to content

Commit

Permalink
[Console] Bootstrap kibana before running generator script (elastic#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
sabarasaba authored Nov 25, 2024
1 parent 043149b commit f7a274a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .buildkite/scripts/steps/console_definitions_sync.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

GIT_SCOPE="src/plugins/console/server/lib/spec_definitions"

report_main_step () {
echo "--- $1"
}
Expand All @@ -16,14 +18,16 @@ main () {
exit 1
fi

report_main_step "Bootstrapping Kibana"
cd "$KIBANA_DIR"
.buildkite/scripts/bootstrap.sh

report_main_step "Generating console definitions"
node scripts/generate_console_definitions.js --source "$PARENT_DIR/elasticsearch-specification" --emptyDest

# Check if there are any differences
set +e
git diff --exit-code --quiet "$destination_file"
git diff --exit-code --quiet "$GIT_SCOPE"
if [ $? -eq 0 ]; then
echo "No differences found. Exiting.."
exit
Expand Down Expand Up @@ -54,7 +58,7 @@ main () {

git checkout -b "$BRANCH_NAME"

git add src/plugins/console/server/lib/spec_definitions/json/generated/*
git add $GIT_SCOPE
git commit -m "Update console definitions"

report_main_step "Changes committed. Creating pull request."
Expand Down

0 comments on commit f7a274a

Please sign in to comment.