Skip to content

Commit

Permalink
Fix product repo PR checkout (#2913)
Browse files Browse the repository at this point in the history
* Fix product repo PR checkout

* disable cancelling running PRs

* disable use https flag
  • Loading branch information
nkammah committed Jan 29, 2024
1 parent 0687849 commit 080b767
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .buildkite/build_pr_pipeline.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 4 additions & 4 deletions .buildkite/scripts/build_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 080b767

Please sign in to comment.