Skip to content
Snippets Groups Projects
Commit 0613f564 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

CI: adding NRF as submodules

parent a2fcdc1c
No related branches found
No related tags found
No related merge requests found
...@@ -7,3 +7,6 @@ ...@@ -7,3 +7,6 @@
[submodule "component/oai-upf-equivalent"] [submodule "component/oai-upf-equivalent"]
path = component/oai-upf-equivalent path = component/oai-upf-equivalent
url = https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git url = https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git
[submodule "component/oai-nrf"]
path = component/oai-nrf
url = https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf.git
...@@ -57,6 +57,8 @@ def scmEvent = false ...@@ -57,6 +57,8 @@ def scmEvent = false
def upstreamEvent = false def upstreamEvent = false
// Default tags / branches --> could be passed on by upstream job or by PR content // Default tags / branches --> could be passed on by upstream job or by PR content
def nrfTag = 'develop'
def nrfBranch = 'develop'
def amfTag = 'develop' def amfTag = 'develop'
def amfBranch = 'develop' def amfBranch = 'develop'
def smfTag = 'develop' def smfTag = 'develop'
...@@ -136,6 +138,14 @@ pipeline { ...@@ -136,6 +138,14 @@ pipeline {
} }
if (upstreamEvent) { if (upstreamEvent) {
if (params.NRF_TAG != null) {
nrfTag = params.NRF_TAG
echo "Upstream Job passed NRF_TAG to use: ${nrfTag}"
}
if (params.NRF_BRANCH != null) {
nrfBranch = params.NRF_BRANCH
echo "Upstream Job passed NRF_BRANCH to use: ${nrfBranch}"
}
if (params.AMF_TAG != null) { if (params.AMF_TAG != null) {
amfTag = params.AMF_TAG amfTag = params.AMF_TAG
echo "Upstream Job passed AMF_TAG to use: ${amfTag}" echo "Upstream Job passed AMF_TAG to use: ${amfTag}"
...@@ -157,13 +167,13 @@ pipeline { ...@@ -157,13 +167,13 @@ pipeline {
sh 'git checkout -f ' + upstreamTagToUse sh 'git checkout -f ' + upstreamTagToUse
sh "zip -r -qq oai-cn5g-fed.zip .git" sh "zip -r -qq oai-cn5g-fed.zip .git"
sh "mkdir -p archives DS-TEST-RESULTS" sh "mkdir -p archives DS-TEST-RESULTS"
sh './scripts/syncComponents.sh --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch sh './scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch
if (new_host_flag) { if (new_host_flag) {
// Prepare the workspace in remote server // Prepare the workspace in remote server
copyTo2ndServer('oai-cn5g-fed.zip', new_host_flag, new_host_user, new_host) copyTo2ndServer('oai-cn5g-fed.zip', new_host_flag, new_host_user, new_host)
myShCmd('git clean -x -d -f > /dev/null 2>&1', new_host_flag, new_host_user, new_host) myShCmd('git clean -x -d -f > /dev/null 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('mkdir -p archives DS-TEST-RESULTS', new_host_flag, new_host_user, new_host) myShCmd('mkdir -p archives DS-TEST-RESULTS', new_host_flag, new_host_user, new_host)
myShCmd('./scripts/syncComponents.sh --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch, new_host_flag, new_host_user, new_host) myShCmd('./scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch, new_host_flag, new_host_user, new_host)
} }
} }
if (scmEvent) { if (scmEvent) {
...@@ -187,7 +197,7 @@ pipeline { ...@@ -187,7 +197,7 @@ pipeline {
} }
if ((!upstreamEvent) && (!scmEvent)) { if ((!upstreamEvent) && (!scmEvent)) {
sh "git clean -x -d -f > /dev/null 2>&1" sh "git clean -x -d -f > /dev/null 2>&1"
sh './scripts/syncComponents.sh --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch sh './scripts/syncComponents.sh --nrf-branch ' + nrfBranch + ' --amf-branch ' + amfBranch + ' --smf-branch ' + smfBranch + ' --spgwu-tiny-branch ' + spgwuBranch
sh "mkdir -p archives DS-TEST-RESULTS" sh "mkdir -p archives DS-TEST-RESULTS"
} }
} }
......
Subproject commit 738473e2d16d78569acb8ded41a363bac8c0deeb
...@@ -36,6 +36,9 @@ function usage { ...@@ -36,6 +36,9 @@ function usage {
echo "" echo ""
echo "Options:" echo "Options:"
echo "--------" echo "--------"
echo " --nrf-branch ####"
echo " Specify the source branch for the OAI-NRF component"
echo ""
echo " --amf-branch ####" echo " --amf-branch ####"
echo " Specify the source branch for the OAI-AMF component" echo " Specify the source branch for the OAI-AMF component"
echo "" echo ""
...@@ -50,6 +53,7 @@ function usage { ...@@ -50,6 +53,7 @@ function usage {
echo "" echo ""
} }
NRF_BRANCH='develop'
AMF_BRANCH='develop' AMF_BRANCH='develop'
SMF_BRANCH='develop' SMF_BRANCH='develop'
SPGWU_BRANCH='master' SPGWU_BRANCH='master'
...@@ -66,6 +70,12 @@ case $key in ...@@ -66,6 +70,12 @@ case $key in
usage usage
exit 0 exit 0
;; ;;
--nrf-branch)
NRF_BRANCH="$2"
doDefault=0
shift
shift
;;
--amf-branch) --amf-branch)
AMF_BRANCH="$2" AMF_BRANCH="$2"
doDefault=0 doDefault=0
...@@ -94,6 +104,7 @@ esac ...@@ -94,6 +104,7 @@ esac
done done
echo "---------------------------------------------------------" echo "---------------------------------------------------------"
echo "OAI-NRF component branch : ${NRF_BRANCH}"
echo "OAI-AMF component branch : ${AMF_BRANCH}" echo "OAI-AMF component branch : ${AMF_BRANCH}"
echo "OAI-SMF component branch : ${SMF_BRANCH}" echo "OAI-SMF component branch : ${SMF_BRANCH}"
echo "OAI-SPGW-U component branch : ${SPGWU_BRANCH}" echo "OAI-SPGW-U component branch : ${SPGWU_BRANCH}"
...@@ -112,6 +123,11 @@ if [ $doDefault -eq 1 ] ...@@ -112,6 +123,11 @@ if [ $doDefault -eq 1 ]
then then
git submodule foreach 'git fetch --prune && git checkout develop && git pull origin develop' > /dev/null 2>&1 git submodule foreach 'git fetch --prune && git checkout develop && git pull origin develop' > /dev/null 2>&1
else else
pushd component/oai-nrf
git fetch --prune > /dev/null 2>&1
git checkout $NRF_BRANCH > /dev/null 2>&1
git pull origin $NRF_BRANCH > /dev/null 2>&1
popd
pushd component/oai-amf pushd component/oai-amf
git fetch --prune > /dev/null 2>&1 git fetch --prune > /dev/null 2>&1
git checkout $AMF_BRANCH > /dev/null 2>&1 git checkout $AMF_BRANCH > /dev/null 2>&1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment