mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
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:
@@ -9,6 +9,11 @@ variables:
|
|||||||
KUBESPRAY_VERSION: v2.27.0
|
KUBESPRAY_VERSION: v2.27.0
|
||||||
FAILFASTCI_NAMESPACE: 'kargo-ci'
|
FAILFASTCI_NAMESPACE: 'kargo-ci'
|
||||||
GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
|
GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
|
||||||
|
GIT_CONFIG_COUNT: 1
|
||||||
|
GIT_CONFIG_KEY_0: user.key
|
||||||
|
GIT_CONFIG_VALUE_0: "ci@kubespray.io"
|
||||||
|
GIT_CONFIG_KEY_1: user.name
|
||||||
|
GIT_CONFIG_VALUE_1: "CI"
|
||||||
ANSIBLE_FORCE_COLOR: "true"
|
ANSIBLE_FORCE_COLOR: "true"
|
||||||
MAGIC: "ci check this"
|
MAGIC: "ci check this"
|
||||||
GS_ACCESS_KEY_ID: $GS_KEY
|
GS_ACCESS_KEY_ID: $GS_KEY
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -euxo pipefail
|
set -ex
|
||||||
|
|
||||||
KUBESPRAY_NEXT_VERSION=2.$(( ${KUBESPRAY_VERSION:3:2} + 1 ))
|
if [ "${GITHUB_BASE_REF}" ]; then
|
||||||
|
git pull --rebase origin $GITHUB_BASE_REF
|
||||||
# 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
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user