mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
CI: Remove doGitLabMerge.sh
Checkout to tested branch is performed via Jenkins SCM checkout from
internal git repository (git@asterix:/home/git/openairinterface5g.git).
Target branch to checkout is given as {sourceBranch}-{sourceCommit},
which was created and pushed to the internal repository in
RAN-Local-Repo-Push stage.
Signed-off-by: Jaroslava Fiedlerova <jaroslava.fiedlerova@openairinterface.org>
This commit is contained in:
7
ci-scripts/Jenkinsfile
vendored
7
ci-scripts/Jenkinsfile
vendored
@@ -92,13 +92,6 @@ pipeline {
|
||||
|
||||
if (allParametersPresent) {
|
||||
echo '\u2705 \u001B[94m All parameters are present\u001B[0m'
|
||||
if (is_MR) {
|
||||
sh "git fetch"
|
||||
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${sourceBranch} --src-commit ${commitID} --target-branch ${targetBranch} --target-commit latest"
|
||||
} else {
|
||||
sh "git fetch"
|
||||
sh "git checkout -f ${commitID}"
|
||||
}
|
||||
} else {
|
||||
echo "\u274C Some parameters are missing"
|
||||
sh "./ci-scripts/fail.sh"
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
function usage {
|
||||
echo "OAI GitLab merge request applying script"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo ""
|
||||
echo " doGitLabMerge.sh [OPTIONS] [MANDATORY_OPTIONS]"
|
||||
echo ""
|
||||
echo "Mandatory Options:"
|
||||
echo "------------------"
|
||||
echo ""
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --src-commit #### OR -sc ####"
|
||||
echo " Specify the source commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --target-commit #### OR -tc ####"
|
||||
echo " Specify the target commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 8 ] && [ $# -ne 1 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
checker=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-sc|--src-commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tc|--target-commit)
|
||||
TARGET_COMMIT_ID="$2"
|
||||
let "checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
if [[ $TARGET_COMMIT_ID == "latest" ]]
|
||||
then
|
||||
TARGET_COMMIT_ID=`git log -n1 --pretty=format:%H origin/$TARGET_BRANCH`
|
||||
fi
|
||||
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Source Commit ID is : $SOURCE_COMMIT_ID"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Target Commit ID is : $TARGET_COMMIT_ID"
|
||||
|
||||
if [ $checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing option"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git config user.email "jenkins@openairinterface.org"
|
||||
git config user.name "OAI Jenkins"
|
||||
|
||||
git checkout -f $SOURCE_COMMIT_ID > checkout.txt 2>&1
|
||||
STATUS=`grep -E -c "fatal: reference is not a tree" checkout.txt`
|
||||
rm -f checkout.txt
|
||||
if [ $STATUS -ne 0 ]
|
||||
then
|
||||
echo "fatal: reference is not a tree --> $SOURCE_COMMIT_ID"
|
||||
STATUS=-1
|
||||
exit $STATUS
|
||||
fi
|
||||
|
||||
git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI"
|
||||
|
||||
STATUS=`git status | grep -E -c "You have unmerged paths.|fix conflicts"`
|
||||
if [ $STATUS -ne 0 ]
|
||||
then
|
||||
echo "There are merge conflicts.. Cannot perform further build tasks"
|
||||
STATUS=-1
|
||||
fi
|
||||
exit $STATUS
|
||||
Reference in New Issue
Block a user