the create_workspace.sh script checks if a branch should be merged into
what we are trying to checkount (i.e., typically develop into
feature-branch). The problem is that it uses a short-hand for an if
branch.
[ -n "${merge}"] && git merge...
If we don't request a merge, [ -n XX ] will evalute to 1, and not do the
git merge. Since it's the last command in the script, this makes the
script return 1 (failure), when it actually succeeded.
Add exit 0 to ensure we return 0 after successful end of the script. If
there is a failure, the script will terminate early. It can be tested by
e.g., giving a wrong commit ID.
Reviewed-by: Jaroslava Fiedlerova <Jaroslava.Fiedlerova@openairinterface.org>
27 lines
520 B
Bash
Executable File
27 lines
520 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function die() {
|
|
echo $@
|
|
exit 1
|
|
}
|
|
|
|
[ $# -ge 3 -a $# -le 4 ] || die "usage: $0 <directory> <repository> <ref> [<merge-ref>]"
|
|
|
|
set -ex
|
|
|
|
dir=$1
|
|
repo=$2
|
|
ref=$3
|
|
merge=$4
|
|
|
|
rm -rf ${dir}
|
|
git clone --filter=blob:none -n -b develop ${repo} ${dir}
|
|
cd ${dir}
|
|
git config user.email "jenkins@openairinterface.org"
|
|
git config user.name "OAI Jenkins"
|
|
git config advice.detachedHead false
|
|
mkdir -p cmake_targets/log
|
|
git checkout -f ${ref}
|
|
[ -n "${merge}" ] && git merge --ff ${merge} -m "Temporary merge for CI"
|
|
exit 0
|