From 5a7779008fd162388501412a41d62c40b53ce080 Mon Sep 17 00:00:00 2001 From: nassimkammah Date: Thu, 18 Jan 2024 21:30:19 +0100 Subject: [PATCH] Switch to using master and drop the _bk_ prefix for Buildkite builds --- .buildkite/air_gapped_pipeline.yml | 2 +- .buildkite/build_pipeline.yml | 8 -- .buildkite/build_pr_pipeline.yml | 8 -- .buildkite/scripts/build.sh | 3 +- .buildkite/scripts/build_pr.sh | 2 +- .../scripts/compare_bk_jenkins_branches.sh | 81 ------------------- 6 files changed, 3 insertions(+), 101 deletions(-) delete mode 100755 .buildkite/scripts/compare_bk_jenkins_branches.sh diff --git a/.buildkite/air_gapped_pipeline.yml b/.buildkite/air_gapped_pipeline.yml index f0f5f5fbc6bab..9c744010bb5e6 100644 --- a/.buildkite/air_gapped_pipeline.yml +++ b/.buildkite/air_gapped_pipeline.yml @@ -2,7 +2,7 @@ steps: - label: ":white_check_mark: Build air-gapped" command: ".buildkite/scripts/publish_air_gapped_docs.sh" env: - AIR_GAPPED: "docker.elastic.co/docs-private/bk_air_gapped:latest" + AIR_GAPPED: "docker.elastic.co/docs-private/air_gapped:latest" agents: provider: "gcp" image: family/docs-ubuntu-2204 diff --git a/.buildkite/build_pipeline.yml b/.buildkite/build_pipeline.yml index ecd3cab3699dd..e2defd2ac51be 100644 --- a/.buildkite/build_pipeline.yml +++ b/.buildkite/build_pipeline.yml @@ -34,14 +34,6 @@ steps: provider: "gcp" image: family/docs-ubuntu-2204 machineType: ${BUILD_MACHINE_TYPE} - - wait - - key: "branch-comparison" - label: "Compare branches" - command: | - .buildkite/scripts/compare_bk_jenkins_branches.sh staging master - agents: - provider: "gcp" - image: family/docs-ubuntu-2204 notify: - email: "docs-status@elastic.co" if: build.state == "failed" diff --git a/.buildkite/build_pr_pipeline.yml b/.buildkite/build_pr_pipeline.yml index e4978486a182b..2cae5bcc12a47 100644 --- a/.buildkite/build_pr_pipeline.yml +++ b/.buildkite/build_pr_pipeline.yml @@ -24,11 +24,3 @@ steps: fi depends_on: - step: "build-pr" - - wait - - key: "branch-comparison" - label: "Compare branches" - command: | - .buildkite/scripts/compare_bk_jenkins_branches.sh ${GITHUB_PR_BASE_REPO}_bk_${GITHUB_PR_NUMBER} ${GITHUB_PR_BASE_REPO}_${GITHUB_PR_NUMBER} - agents: - provider: "gcp" - image: family/docs-ubuntu-2204 diff --git a/.buildkite/scripts/build.sh b/.buildkite/scripts/build.sh index 0eb9756ccf0e8..831e7684606e9 100755 --- a/.buildkite/scripts/build.sh +++ b/.buildkite/scripts/build.sh @@ -25,8 +25,7 @@ elif [[ "${BROKEN_LINKS}" == 'warnlinkcheck' ]]; then fi if [[ "${BUILDKITE_BRANCH}" == "master" ]]; then - # temporary pushing to staging instead of master until the migration is over - build_args+=" --target_branch staging --push" + build_args+=" --push" fi # The docs build can use the ssh agent's authentication socket diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index c16344e1e9429..882bb5e89e4f9 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -70,7 +70,7 @@ fi # Set the target branch and preview options -TARGET_BRANCH="${GITHUB_PR_BASE_REPO}_bk_${GITHUB_PR_NUMBER}" +TARGET_BRANCH="${GITHUB_PR_BASE_REPO}_${GITHUB_PR_NUMBER}" PREVIEW_URL="https://${TARGET_BRANCH}.docs-preview.app.elstc.co" build_cmd="./build_docs --all \ diff --git a/.buildkite/scripts/compare_bk_jenkins_branches.sh b/.buildkite/scripts/compare_bk_jenkins_branches.sh deleted file mode 100755 index 9b9765aeaafd9..0000000000000 --- a/.buildkite/scripts/compare_bk_jenkins_branches.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - -BUILDKITE_BRANCH=$1 -JENKINS_BRANCH=$2 - -if [ -z ${BUILDKITE_BRANCH} ] || [ -z ${JENKINS_BRANCH} ];then - echo "Missing BUILDKITE_BRANCH or JENKINS_BRANCH - aborting" - exit 1 -fi - -buildkite-agent annotate \ - --style 'info' \ - --context 'branch-comparison' \ - "Attempting to perform programatic comparison of [$BUILDKITE_BRANCH..$JENKINS_BRANCH](https://github.com/elastic/built-docs/compare/$BUILDKITE_BRANCH..$JENKINS_BRANCH)" - -# Start by fetching the 2 branches -git clone --reference /opt/git-mirrors/elastic-built-docs git@github.com:elastic/built-docs.git built-docs - -cd built-docs - -# Check if we're expecting a remote branch -git ls-remote --exit-code --heads origin $BUILDKITE_BRANCH -bk=$? - -if [ $bk -ne 0 ]; then - buildkite-agent annotate \ - --append \ - --context 'branch-comparison' \ - "No branches produced - aborting" - buildkite-agent meta-data set "bk-jenkins-branch-comparison" "skipping-no-branches" - exit 0 -fi - -# Let's sleep a few minutes to let Jenkins catch-up -sleep 3m - -git ls-remote --exit-code --heads origin $JENKINS_BRANCH -jen=$? - -if [ $jen -ne 0 ]; then - buildkite-agent annotate \ - --append \ - --context 'branch-comparison' \ - "[Jenkins branch](https://github.com/elastic/built-docs/tree/$JENKINS_BRANCH) not found in time - aborting" - buildkite-agent meta-data set "bk-jenkins-branch-comparison" "skipping-missing-jenkins-branch" - exit 0 -fi - -echo "Fetching Jenkins branch" -git fetch origin $JENKINS_BRANCH:$JENKINS_BRANCH - -echo "Fetching Buildkite branch" -git fetch origin $BUILDKITE_BRANCH:$BUILDKITE_BRANCH - -git --no-pager log -1 --format=%ct $JENKINS_BRANCH -jen=$? -git --no-pager log -1 --format=%ct $BUILDKITE_BRANCH -bk=$? - - -branches_age_diff=`expr $bk - $jen` -echo "Branches age difference (s) is $branches_age_diff" -if [ "$branches_age_diff" -gt 1800 ]; then - buildkite-agent annotate --append --context 'branch-comparison' "
Jenkins and Buildkite branches are more than 30 minutes apart - skipping comparison" - buildkite-agent meta-data set "bk-jenkins-branch-comparison" "skipping-age-difference" - exit 0 -fi - -echo "Comparing the two branches, excluding branches.yaml changes, and changes with /tmp or in them" -diff_out=`git diff $BUILDKITE_BRANCH..$JENKINS_BRANCH -- . ':(exclude)html/branches.yaml' | grep -v "\-\-\-" | grep -E "^\-|Binary" | grep -vE "\/tmp|"` -retVal=$? - -if [ $retVal -eq 0 ]; then - buildkite-agent annotate --append --style 'warning' --context 'branch-comparison' '
Branches differ' - buildkite-agent meta-data set "bk-jenkins-branch-comparison" "different" - echo $diff_out -else - buildkite-agent annotate --append --style 'success' --context 'branch-comparison' '
Branches are identical' - buildkite-agent meta-data set "bk-jenkins-branch-comparison" "identical" -fi -