Browse Source

CI: simplify rebase.sh

With the base ref (aka: target branch) available, we don't need to guess
stuff from the branch name
pull/12050/head
Max Gautier 6 months ago
parent
commit
0c59cc84dd
Failed to extract signature
2 changed files with 9 additions and 13 deletions
  1. 5
      .gitlab-ci.yml
  2. 17
      tests/scripts/rebase.sh

5
.gitlab-ci.yml

@ -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

17
tests/scripts/rebase.sh

@ -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 fi
Loading…
Cancel
Save