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
1 merge request!3CI: deployment using docker-compose
......@@ -7,3 +7,6 @@
[submodule "component/oai-upf-equivalent"]
path = component/oai-upf-equivalent
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
def upstreamEvent = false
// Default tags / branches --> could be passed on by upstream job or by PR content
def nrfTag = 'develop'
def nrfBranch = 'develop'
def amfTag = 'develop'
def amfBranch = 'develop'
def smfTag = 'develop'
......@@ -136,6 +138,14 @@ pipeline {
}
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) {
amfTag = params.AMF_TAG
echo "Upstream Job passed AMF_TAG to use: ${amfTag}"
......@@ -157,13 +167,13 @@ pipeline {
sh 'git checkout -f ' + upstreamTagToUse
sh "zip -r -qq oai-cn5g-fed.zip .git"
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) {
// Prepare the workspace in remote server
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('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) {
......@@ -187,7 +197,7 @@ pipeline {
}
if ((!upstreamEvent) && (!scmEvent)) {
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"
}
}
......
Subproject commit 738473e2d16d78569acb8ded41a363bac8c0deeb
......@@ -36,6 +36,9 @@ function usage {
echo ""
echo "Options:"
echo "--------"
echo " --nrf-branch ####"
echo " Specify the source branch for the OAI-NRF component"
echo ""
echo " --amf-branch ####"
echo " Specify the source branch for the OAI-AMF component"
echo ""
......@@ -50,6 +53,7 @@ function usage {
echo ""
}
NRF_BRANCH='develop'
AMF_BRANCH='develop'
SMF_BRANCH='develop'
SPGWU_BRANCH='master'
......@@ -66,6 +70,12 @@ case $key in
usage
exit 0
;;
--nrf-branch)
NRF_BRANCH="$2"
doDefault=0
shift
shift
;;
--amf-branch)
AMF_BRANCH="$2"
doDefault=0
......@@ -94,6 +104,7 @@ esac
done
echo "---------------------------------------------------------"
echo "OAI-NRF component branch : ${NRF_BRANCH}"
echo "OAI-AMF component branch : ${AMF_BRANCH}"
echo "OAI-SMF component branch : ${SMF_BRANCH}"
echo "OAI-SPGW-U component branch : ${SPGWU_BRANCH}"
......@@ -112,6 +123,11 @@ if [ $doDefault -eq 1 ]
then
git submodule foreach 'git fetch --prune && git checkout develop && git pull origin develop' > /dev/null 2>&1
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
git fetch --prune > /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