mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 01:28:11 -03:30
CI: simplify rebase.sh
With the base ref (aka: target branch) available, we don't need to guess stuff from the branch name
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
KUBESPRAY_NEXT_VERSION=2.$(( ${KUBESPRAY_VERSION:3:2} + 1 ))
|
||||
|
||||
# Rebase PRs on master (or release branch) to get latest changes
|
||||
if [[ $CI_COMMIT_REF_NAME == pr-* ]]; then
|
||||
git config user.email "ci@kubespray.io"
|
||||
git config user.name "CI"
|
||||
if [[ -z "`git branch -a --list origin/release-$KUBESPRAY_NEXT_VERSION`" ]]; then
|
||||
git pull --rebase origin master
|
||||
else
|
||||
git pull --rebase origin release-$KUBESPRAY_NEXT_VERSION
|
||||
fi
|
||||
if [ "${GITHUB_BASE_REF}" ]; then
|
||||
git pull --rebase origin $GITHUB_BASE_REF
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user