From 080b7673be97afcf0bc58d823b7cc1226b7d7e3f Mon Sep 17 00:00:00 2001 From: Nassim Kammah Date: Mon, 29 Jan 2024 18:51:58 +0100 Subject: [PATCH] Fix product repo PR checkout (#2913) * Fix product repo PR checkout * disable cancelling running PRs * disable use https flag --- .buildkite/build_pr_pipeline.yml | 6 +++--- .buildkite/scripts/build_pr.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.buildkite/build_pr_pipeline.yml b/.buildkite/build_pr_pipeline.yml index 3c5225b9ef6c7..f7023abc34b99 100644 --- a/.buildkite/build_pr_pipeline.yml +++ b/.buildkite/build_pr_pipeline.yml @@ -1,9 +1,9 @@ env: - USE_HTTPS_CLONE: true + USE_HTTPS_CLONE: false steps: - - key: "cancel-existing-builds" - command: ".buildkite/scripts/cancel_running_pr.sh || true" + #- key: "cancel-existing-builds" + # command: ".buildkite/scripts/cancel_running_pr.sh || true" - key: "build-pr-setup" label: "setup" command: ".buildkite/scripts/build_pr_commit_status.sh pending" diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index c16344e1e9429..39cdd321c338f 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -3,8 +3,8 @@ set -euo pipefail set +x # This script should only be invoked by the Buildkite PR bot -if [ -z ${GITHUB_PR_BRANCH+set} ] || [ -z ${GITHUB_PR_TARGET_BRANCH+set} ] || [ -z ${GITHUB_PR_NUMBER+set} ] || [ -z ${GITHUB_PR_BASE_REPO+set} ];then - echo "One of the following env. variable GITHUB_PR_BRANCH, GITHUB_PR_TARGET_BRANCH, GITHUB_PR_NUMBER, GITHUB_PR_BASE_REPO is missing - exiting." +if [ -z ${GITHUB_PR_TARGET_BRANCH+set} ] || [ -z ${GITHUB_PR_NUMBER+set} ] || [ -z ${GITHUB_PR_BASE_REPO+set} ];then + echo "One of the following env. variable GITHUB_PR_TARGET_BRANCH, GITHUB_PR_NUMBER, GITHUB_PR_BASE_REPO is missing - exiting." exit 1 fi @@ -51,8 +51,8 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then git@github.com:elastic/$GITHUB_PR_BASE_REPO.git ./product-repo cd ./product-repo && - git fetch origin pull/$GITHUB_PR_NUMBER/head:$GITHUB_PR_BRANCH && - git switch $GITHUB_PR_BRANCH && + git fetch origin pull/$GITHUB_PR_NUMBER/head:pr_$GITHUB_PR_NUMBER && + git switch pr_$GITHUB_PR_NUMBER && cd .. # For product repos - context in https://github.com/elastic/docs/commit/5b06c2dc1f50208fcf6025eaed6d5c4e81200330 build_args+=" --keep_hash"