diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab
index 510d594eb5..442e5d3791 100644
--- a/ci-scripts/Jenkinsfile-gitlab
+++ b/ci-scripts/Jenkinsfile-gitlab
@@ -9,34 +9,66 @@ pipeline {
timestamps()
gitLabConnection('OAI GitLab')
//gitlabBuilds(builds: ["Build", "Test"])
+ gitlabBuilds(builds: ["Local Build"])
}
stages {
- stage ("Verify Parameters") {
+ stage ("Verify Guidelines") {
steps {
- echo 'Verify Parameters'
echo "Git URL is ${GIT_URL}"
echo "GitLab Act is ${env.gitlabActionType}"
script {
if ("MERGE".equals(env.gitlabActionType)) {
- // GitLab-Jenkins pugin integration is lacking to perform the merge by itself
+ // GitLab-Jenkins plugin integration is lacking to perform the merge by itself
// Doing it manually --> it may have merge conflicts
- sh "./ci-scripts/doGitLabMerge.sh ${env.gitlabSourceBranch} ${env.gitlabMergeRequestLastCommit} ${env.gitlabTargetBranch} ${GIT_COMMIT}"
- sh "./ci-scripts/checkCodingFormattingRules.sh ${env.gitlabSourceBranch} ${env.gitlabTargetBranch}"
+ sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
+
+ // Running astyle options on the list of modified files by the merge request
+ // For the moment, there is no fail criteria. Just a notification of number of files that do not follow
+ sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
def res=readFile('./oai_rules_result.txt').trim();
if ("0".equals(res)) {
- addGitLabMRComment comment: "All Changed files in Merge Request follow OAI Formatting Rules"
+ def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
+ addGitLabMRComment comment: message
} else {
- addGitLabMRComment comment: "Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
+ def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
+ addGitLabMRComment comment: message
}
} else {
echo "Git Branch is ${GIT_BRANCH}"
echo "Git Commit is ${GIT_COMMIT}"
+
+ // Running astyle options on all C/H files in the repository
+ // For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh"
}
}
}
}
+ stage ("Local Build") {
+ steps {
+ gitlabCommitStatus(name: "Local Build") {
+ sh "./ci-scripts/buildLocally.sh --workspace $WORKSPACE"
+ }
+ }
+ post {
+ always {
+ script {
+ if(fileExists('archives/local_build_logs.zip')) {
+ archiveArtifacts artifacts: 'archives/local_build_logs.zip'
+ }
+ if ("MERGE".equals(env.gitlabActionType)) {
+ sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
+ } else {
+ sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
+ }
+ if(fileExists('build_results.html')) {
+ archiveArtifacts artifacts: 'build_results.html'
+ }
+ }
+ }
+ }
+ }
}
post {
always {
@@ -46,11 +78,11 @@ pipeline {
}
success {
script {
- def message = "OAI build #" + BUILD_ID + " passed (" + BUILD_URL + ")"
+ def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
- def message2 = "OAI build #" + BUILD_ID + " passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
+ def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
slackSend channel: 'ci-enb', color: 'good', message: message2
} else {
slackSend channel: 'ci-enb', color: 'good', message: message
@@ -59,11 +91,11 @@ pipeline {
}
failure {
script {
- def message = "OAI build #" + BUILD_ID + " failed (" + BUILD_URL + ")"
+ def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
- def message2 = "OAI build #" + BUILD_ID + " failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
+ def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
slackSend channel: 'ci-enb', color: 'danger', message: message2
} else {
slackSend channel: 'ci-enb', color: 'danger', message: message
diff --git a/ci-scripts/buildLocally.sh b/ci-scripts/buildLocally.sh
new file mode 100755
index 0000000000..6701950832
--- /dev/null
+++ b/ci-scripts/buildLocally.sh
@@ -0,0 +1,153 @@
+#!/bin/bash
+
+function usage {
+ echo "OAI Local Build Check script"
+ echo " Original Author: Raphael Defosseux"
+ echo ""
+ echo "Usage:"
+ echo "------"
+ echo " buildLocally.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo "--------"
+ echo " --workspace #### OR -ws ####"
+ echo " Specify the workspace"
+ echo ""
+ echo " --help OR -h"
+ echo " Print this help message."
+ echo ""
+}
+
+if [ $# -ne 2 ] && [ $# -ne 1 ]
+then
+ echo "Syntax Error: not the correct number of arguments"
+ echo ""
+ usage
+ exit 1
+fi
+
+while [[ $# -gt 0 ]]
+do
+key="$1"
+
+case $key in
+ -h|--help)
+ shift
+ usage
+ exit 0
+ ;;
+ -ws|--workspace)
+ JENKINS_WKSP="$2"
+ shift
+ shift
+ ;;
+ *)
+ echo "Syntax Error: unknown option: $key"
+ echo ""
+ usage
+ exit 1
+esac
+done
+
+cd $JENKINS_WKSP
+STATUS=0
+
+############################################################
+# Creating a tmp folder to store results and artifacts
+############################################################
+if [ ! -d $JENKINS_WKSP/archives ]
+then
+ mkdir $JENKINS_WKSP/archives
+fi
+
+source oaienv
+cd $JENKINS_WKSP/cmake_targets
+
+############################################################
+# Building eNb with USRP option
+############################################################
+ARCHIVES_LOC=$JENKINS_WKSP/archives/enb_usrp
+if [ ! -d $ARCHIVES_LOC ]
+then
+ mkdir $ARCHIVES_LOC
+fi
+./build_oai --eNB -w USRP -c
+
+# Generated log files:
+if [ -f $JENKINS_WKSP/cmake_targets/log/lte-softmodem.Rel14.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target lte-softmodem" $JENKINS_WKSP/cmake_targets/log/lte-softmodem.Rel14.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/lte-softmodem.Rel14.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+if [ -f $JENKINS_WKSP/cmake_targets/log/params_libconfig.Rel14.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target params_libconfig" $JENKINS_WKSP/cmake_targets/log/params_libconfig.Rel14.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/params_libconfig.Rel14.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+if [ -f $JENKINS_WKSP/cmake_targets/log/coding.Rel14.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target coding" $JENKINS_WKSP/cmake_targets/log/coding.Rel14.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/coding.Rel14.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+if [ -f $JENKINS_WKSP/cmake_targets/log/oai_usrpdevif.Rel14.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target oai_usrpdevif" $JENKINS_WKSP/cmake_targets/log/oai_usrpdevif.Rel14.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/oai_usrpdevif.Rel14.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+
+############################################################
+# Building basic simulator
+############################################################
+ARCHIVES_LOC=$JENKINS_WKSP/archives/basic_sim
+if [ ! -d $ARCHIVES_LOC ]
+then
+ mkdir $ARCHIVES_LOC
+fi
+cd $JENKINS_WKSP/cmake_targets
+./build_oai --basic-simulator -c
+
+# Generated log files:
+if [ -f $JENKINS_WKSP/cmake_targets/log/basic_simulator_enb.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target lte-softmodem" $JENKINS_WKSP/cmake_targets/log/basic_simulator_enb.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/basic_simulator_enb.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+if [ -f $JENKINS_WKSP/cmake_targets/log/basic_simulator_ue.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target lte-uesoftmodem" $JENKINS_WKSP/cmake_targets/log/basic_simulator_ue.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/basic_simulator_ue.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+if [ -f $JENKINS_WKSP/cmake_targets/log/conf2uedata.Rel14.txt ]
+then
+ LOCAL_STAT=`egrep -c "Built target conf2uedata" $JENKINS_WKSP/cmake_targets/log/conf2uedata.Rel14.txt`
+ if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
+ cp $JENKINS_WKSP/cmake_targets/log/conf2uedata.Rel14.txt $ARCHIVES_LOC
+else
+ STATUS=-1
+fi
+
+############################################################
+# Creating a zip for Jenkins archiving
+############################################################
+cd $JENKINS_WKSP/archives/
+zip -r local_build_logs.zip basic_sim enb_usrp
+
+exit $STATUS
diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh
index fb35ce35ae..20657b7fd0 100755
--- a/ci-scripts/checkCodingFormattingRules.sh
+++ b/ci-scripts/checkCodingFormattingRules.sh
@@ -1,51 +1,121 @@
#!/bin/bash
+function usage {
+ echo "OAI Coding / Formatting Guideline Check script"
+ echo " Original Author: Raphael Defosseux"
+ echo ""
+ echo " Requirement: astyle shall be installed"
+ echo ""
+ echo " By default (no options) the complete repository will be checked"
+ echo " In case of merge request, provided source and target branch,"
+ echo " the script will check only the modified files"
+ echo ""
+ echo "Usage:"
+ echo "------"
+ echo " checkCodingFormattingRules.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo "--------"
+ echo " --src-branch #### OR -sb ####"
+ echo " Specify the source branch of the merge request."
+ echo ""
+ echo " --target-branch #### OR -tb ####"
+ echo " Specify the target branch of the merge request (usually develop)."
+ echo ""
+ echo " --help OR -h"
+ echo " Print this help message."
+ echo ""
+}
+
+if [ $# -ne 4 ] && [ $# -ne 1 ] && [ $# -ne 0 ]
+then
+ echo "Syntax Error: not the correct number of arguments"
+ echo ""
+ usage
+ exit 1
+fi
+
if [ $# -eq 0 ]
then
+ echo " ---- Checking the whole repository ----"
+ echo ""
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted `
echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT"
+ echo $NB_FILES_TO_FORMAT > ./oai_rules_result.txt
exit 0
fi
-if [ $# -eq 2 ]
-then
- # Merge request scenario
-
- SOURCE_BRANCH=$1
- echo "Source Branch is : $SOURCE_BRANCH"
-
- TARGET_BRANCH=$2
- echo "Target Branch is : $TARGET_BRANCH"
-
- MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
- echo "Merged Commit is : $MERGE_COMMMIT"
- TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
- echo "Target Init is : $TARGET_INIT_COMMIT"
-
- # Retrieve the list of modified files since the latest develop commit
- MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
- NB_TO_FORMAT=0
- for FULLFILE in $MODIFIED_FILES
- do
- echo $FULLFILE
- filename=$(basename -- "$FULLFILE")
- EXT="${filename##*.}"
- if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
- then
- TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
- NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
- fi
- done
- echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
- echo $NB_TO_FORMAT > ./oai_rules_result.txt
+checker=0
+while [[ $# -gt 0 ]]
+do
+key="$1"
+case $key in
+ -h|--help)
+ shift
+ usage
exit 0
-fi
+ ;;
+ -sb|--src-branch)
+ SOURCE_BRANCH="$2"
+ let "checker|=0x1"
+ shift
+ shift
+ ;;
+ -tb|--target-branch)
+ TARGET_BRANCH="$2"
+ let "checker|=0x2"
+ shift
+ shift
+ ;;
+ *)
+ echo "Syntax Error: unknown option: $key"
+ echo ""
+ usage
+ exit 1
+esac
-if [ $# -ne 0 ] || [ $# -ne 2 ]
+done
+
+
+if [ $checker -ne 3 ]
then
- echo "Syntax error: $0 without any option will check all files in repository"
- echo " or: $0 source-branch target-branch"
- echo " will only check files that are pushed for a merge-request"
+ echo "Source Branch is : $SOURCE_BRANCH"
+ echo "Target Branch is : $TARGET_BRANCH"
+ echo ""
+ echo "Syntax Error: missing option"
+ echo ""
+ usage
exit 1
fi
+
+# Merge request scenario
+
+MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
+TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
+
+echo " ---- Checking the modified files by the merge request ----"
+echo ""
+echo "Source Branch is : $SOURCE_BRANCH"
+echo "Target Branch is : $TARGET_BRANCH"
+echo "Merged Commit is : $MERGE_COMMMIT"
+echo "Target Init is : $TARGET_INIT_COMMIT"
+
+# Retrieve the list of modified files since the latest develop commit
+MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
+NB_TO_FORMAT=0
+for FULLFILE in $MODIFIED_FILES
+do
+ echo $FULLFILE
+ filename=$(basename -- "$FULLFILE")
+ EXT="${filename##*.}"
+ if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
+ then
+ TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
+ NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
+ fi
+done
+echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
+echo $NB_TO_FORMAT > ./oai_rules_result.txt
+
+exit 0
diff --git a/ci-scripts/doGitLabMerge.sh b/ci-scripts/doGitLabMerge.sh
index 07636cb6cb..cc6f38c810 100755
--- a/ci-scripts/doGitLabMerge.sh
+++ b/ci-scripts/doGitLabMerge.sh
@@ -1,23 +1,102 @@
#!/bin/bash
-if [ $# -ne 4 ]
+function usage {
+ echo "OAI GitLab merge request applying script"
+ echo " Original Author: Raphael Defosseux"
+ 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: $0 src-branch src-commit-id dest-branch dest-commit-id"
+ echo "Syntax Error: not the correct number of arguments"
+ echo ""
+ usage
exit 1
fi
-SOURCE_BRANCH=$1
+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
+
echo "Source Branch is : $SOURCE_BRANCH"
-
-SOURCE_COMMIT_ID=$2
echo "Source Commit ID is : $SOURCE_COMMIT_ID"
-
-TARGET_BRANCH=$3
echo "Target Branch is : $TARGET_BRANCH"
-
-TARGET_COMMIT_ID=$4
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"
@@ -25,3 +104,6 @@ git checkout -f $SOURCE_COMMIT_ID
git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI"
+exit 0
+
+
diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh
new file mode 100755
index 0000000000..d3dd1f52a0
--- /dev/null
+++ b/ci-scripts/reportBuildLocally.sh
@@ -0,0 +1,535 @@
+#!/bin/bash
+
+function usage {
+ echo "OAI Local Build Report script"
+ echo " Original Author: Raphael Defosseux"
+ echo ""
+ echo "Usage:"
+ echo "------"
+ echo ""
+ echo " reportBuildLocally.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo "--------"
+ echo ""
+ echo " --help OR -h"
+ echo " Print this help message."
+ echo ""
+ echo "Job Options:"
+ echo "------------"
+ echo ""
+ echo " --git-url #### OR -gu ####"
+ echo " Specify the URL of the GIT Repository."
+ echo ""
+ echo " --job-name #### OR -jn ####"
+ echo " Specify the name of the Jenkins job."
+ echo ""
+ echo " --build-id #### OR -id ####"
+ echo " Specify the build ID of the Jenkins job."
+ echo ""
+ echo " --trigger merge-request OR -mr"
+ echo " --trigger push OR -pu"
+ echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
+ echo ""
+ echo "Merge-Request 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 "Push Options:"
+ echo "----------------------"
+ echo ""
+ echo " --branch #### OR -br ####"
+ echo " Specify the branch of the push event."
+ echo ""
+ echo " --commit #### OR -co ####"
+ echo " Specify the commit ID (SHA-1) of the push event."
+ echo ""
+ echo ""
+}
+
+function trigger_usage {
+ echo "OAI Local Build Report script"
+ echo " Original Author: Raphael Defosseux"
+ echo ""
+ echo " --trigger merge-request OR -mr"
+ echo " --trigger push OR -pu"
+ echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
+ echo ""
+}
+
+jb_checker=0
+mr_checker=0
+pu_checker=0
+MR_TRIG=0
+PU_TRIG=0
+while [[ $# -gt 0 ]]
+do
+key="$1"
+
+case $key in
+ -h|--help)
+ shift
+ usage
+ exit 0
+ ;;
+ -gu|--git-url)
+ GIT_URL="$2"
+ let "jb_checker|=0x1"
+ shift
+ shift
+ ;;
+ -jn|--job-name)
+ JOB_NAME="$2"
+ let "jb_checker|=0x2"
+ shift
+ shift
+ ;;
+ -id|--build-id)
+ BUILD_ID="$2"
+ let "jb_checker|=0x4"
+ shift
+ shift
+ ;;
+ --trigger)
+ TRIG="$2"
+ case $TRIG in
+ merge-request)
+ MR_TRIG=1
+ ;;
+ push)
+ PU_TRIG=1
+ ;;
+ *)
+ echo ""
+ echo "Syntax Error: Invalid Trigger option -> $TRIG"
+ echo ""
+ trigger_usage
+ exit
+ ;;
+ esac
+ let "jb_checker|=0x8"
+ shift
+ shift
+ ;;
+ -mr)
+ MR_TRIG=1
+ let "jb_checker|=0x8"
+ shift
+ ;;
+ -pu)
+ PU_TRIG=1
+ let "jb_checker|=0x8"
+ shift
+ ;;
+ -sb|--src-branch)
+ SOURCE_BRANCH="$2"
+ let "mr_checker|=0x1"
+ shift
+ shift
+ ;;
+ -sc|--src-commit)
+ SOURCE_COMMIT_ID="$2"
+ let "mr_checker|=0x2"
+ shift
+ shift
+ ;;
+ -tb|--target-branch)
+ TARGET_BRANCH="$2"
+ let "mr_checker|=0x4"
+ shift
+ shift
+ ;;
+ -tc|--target-commit)
+ TARGET_COMMIT_ID="$2"
+ let "mr_checker|=0x8"
+ shift
+ shift
+ ;;
+ -br|--branch)
+ SOURCE_BRANCH="$2"
+ let "pu_checker|=0x1"
+ shift
+ shift
+ ;;
+ -co|--commit)
+ SOURCE_COMMIT_ID="$2"
+ let "pu_checker|=0x2"
+ shift
+ shift
+ ;;
+ *)
+ echo "Syntax Error: unknown option: $key"
+ echo ""
+ usage
+ exit 1
+ ;;
+esac
+
+done
+
+if [ $jb_checker -ne 15 ]
+then
+ echo ""
+ echo "Syntax Error: missing job information."
+ # TODO : list missing info
+ echo ""
+ exit 1
+fi
+
+if [ $PU_TRIG -eq 1 ] && [ $MR_TRIG -eq 1 ]
+then
+ echo ""
+ echo "Syntax Error: trigger action incoherent."
+ echo ""
+ trigger_usage
+ exit 1
+fi
+
+if [ $PU_TRIG -eq 1 ]
+then
+ if [ $pu_checker -ne 3 ]
+ then
+ echo ""
+ echo "Syntax Error: missing push information."
+ # TODO : list missing info
+ echo ""
+ exit 1
+ fi
+fi
+
+if [ $MR_TRIG -eq 1 ]
+then
+ if [ $mr_checker -ne 15 ]
+ then
+ echo ""
+ echo "Syntax Error: missing merge-request information."
+ # TODO : list missing info
+ echo ""
+ exit 1
+ fi
+fi
+
+echo "" > ./build_results.html
+echo "" >> ./build_results.html
+echo "
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Element | " >> ./build_results.html
+echo " Status | " >> ./build_results.html
+echo " Nb Errors | " >> ./build_results.html
+echo " Nb Warnings | " >> ./build_results.html
+echo "
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | LTE SoftModem - Release 14" >> ./build_results.html
+if [ -f ./archives/enb_usrp/lte-softmodem.Rel14.txt ]
+then
+ STATUS=`egrep -c "Built target lte-softmodem" ./archives/enb_usrp/lte-softmodem.Rel14.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/enb_usrp/lte-softmodem.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/enb_usrp/lte-softmodem.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Coding - Release 14" >> ./build_results.html
+if [ -f ./archives/enb_usrp/coding.Rel14.txt ]
+then
+ STATUS=`egrep -c "Built target coding" ./archives/enb_usrp/coding.Rel14.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/enb_usrp/coding.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/enb_usrp/coding.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | OAI USRP device if - Release 14" >> ./build_results.html
+if [ -f ./archives/enb_usrp/oai_usrpdevif.Rel14.txt ]
+then
+ STATUS=`egrep -c "Built target oai_usrpdevif" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Parameters Lib Config - Release 14" >> ./build_results.html
+if [ -f ./archives/enb_usrp/params_libconfig.Rel14.txt ]
+then
+ STATUS=`egrep -c "Built target params_libconfig" ./archives/enb_usrp/params_libconfig.Rel14.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/enb_usrp/params_libconfig.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/enb_usrp/params_libconfig.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo "
" >> ./build_results.html
+
+# conf2uedata.Rel14.txt
+# archives/basic_sim
+
+echo " " >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Element | " >> ./build_results.html
+echo " Status | " >> ./build_results.html
+echo " Nb Errors | " >> ./build_results.html
+echo " Nb Warnings | " >> ./build_results.html
+echo "
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Basic Simulator eNb - Release 14" >> ./build_results.html
+if [ -f ./archives/basic_sim/basic_simulator_enb.txt ]
+then
+ STATUS=`egrep -c "Built target lte-softmodem" ./archives/basic_sim/basic_simulator_enb.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/basic_sim/basic_simulator_enb.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/basic_sim/basic_simulator_enb.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Basic Simulator UE - Release 14" >> ./build_results.html
+if [ -f ./archives/basic_sim/basic_simulator_ue.txt ]
+then
+ STATUS=`egrep -c "Built target lte-uesoftmodem" ./archives/basic_sim/basic_simulator_ue.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/basic_sim/basic_simulator_ue.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/basic_sim/basic_simulator_ue.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo " " >> ./build_results.html
+echo " | Conf 2 UE data - Release 14" >> ./build_results.html
+if [ -f ./archives/basic_sim/conf2uedata.Rel14.txt ]
+then
+ STATUS=`egrep -c "Built target conf2uedata" ./archives/basic_sim/conf2uedata.Rel14.txt`
+ if [ $STATUS -eq 1 ]
+ then
+ echo " | OK" >> ./build_results.html
+ else
+ echo " | KO" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "error:" ./archives/basic_sim/conf2uedata.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+ STATUS=`egrep -c "warning:" ./archives/basic_sim/conf2uedata.Rel14.txt`
+ if [ $STATUS -eq 0 ]
+ then
+ echo " | $STATUS" >> ./build_results.html
+ else
+ echo " | $STATUS" >> ./build_results.html
+ fi
+else
+ echo " | Unknown" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+ echo " | --" >> ./build_results.html
+fi
+echo " |
" >> ./build_results.html
+echo "
" >> ./build_results.html
+
+echo "" >> ./build_results.html
+echo "" >> ./build_results.html
+
+exit 0
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 2de8298ffc..b1fc933e96 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -968,7 +968,8 @@ fi
{
cd $OPENAIR_DIR/cmake_targets/basic_simulator/enb
cmake .
- make -j`nproc` coding params_libconfig tcp_bridge_oai lte-softmodem
+ make -j`nproc` lte-softmodem
+ make -j`nproc` coding params_libconfig tcp_bridge_oai
ln -sf libtcp_bridge_oai.so liboai_device.so
cd ../..
} > $dlog/basic_simulator_enb.txt 2>&1
@@ -1023,7 +1024,8 @@ fi
{
cd $OPENAIR_DIR/cmake_targets/basic_simulator/ue
cmake .
- make -j`nproc` coding params_libconfig tcp_bridge_oai lte-uesoftmodem
+ make -j`nproc` lte-uesoftmodem
+ make -j`nproc` coding params_libconfig tcp_bridge_oai
ln -sf libtcp_bridge_oai.so liboai_device.so
cd ../..
} > $dlog/basic_simulator_ue.txt 2>&1