Implement CreateWorkspace() through script, print dir in HTML

Use a script, which can be tested independently of CI code (by running
it on the host on which it will be used), and print the directory that
has been prepared in the HTML.  Also, in the description, use the
infinitive/imperative(?) of the verb to harmonize with other steps.
This commit is contained in:
Robert Schmidt
2024-09-28 12:58:06 +02:00
parent e541aee49e
commit 60b9649e00
58 changed files with 94 additions and 93 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/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"