From fd214f6a7df3aa4a89a178d59e8b82bf482d7b18 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Tue, 14 Apr 2026 13:51:09 +0200 Subject: [PATCH] rewrite pipeline to reflect pushing same commits to both remotes --- Jenkinsfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a274ba4..33c9d78 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,10 +29,15 @@ pipeline { git config user.name "Jenkins Server" git config user.email jenkins@confdroid.com git fetch origin - # Reset the workspace to the exact branch revision that triggered the build. - git checkout -B "$BRANCH_NAME" "origin/$BRANCH_NAME" - # Create an isolated build branch from the triggering branch. - git checkout -B jenkins-build-$BUILD_NUMBER + source_branch="${gitlabSourceBranch:-${BRANCH_NAME:-${GIT_LOCAL_BRANCH:-$GIT_BRANCH}}}" + source_branch="${source_branch#origin/}" + source_branch="${source_branch#refs/heads/}" + if [ -z "$source_branch" ]; then + source_branch="development" + fi + echo "Using source branch: $source_branch" + # Create an isolated build branch from the triggering branch revision. + git checkout -B jenkins-build-$BUILD_NUMBER "origin/$source_branch" # Merge the current master into the build branch before validation. git merge origin/master --no-ff || { echo "Merge conflict detected"; exit 1; } '''