Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
bee19973
Commit
bee19973
authored
Jun 25, 2018
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: Latest version of CI for gNB project
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
adca460e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
8 deletions
+113
-8
ci-scripts/Jenkinsfile-gitlab
ci-scripts/Jenkinsfile-gitlab
+14
-7
ci-scripts/buildOnVM.sh
ci-scripts/buildOnVM.sh
+18
-1
ci-scripts/destroyAllRunningVM.sh
ci-scripts/destroyAllRunningVM.sh
+81
-0
No files found.
ci-scripts/Jenkinsfile-gitlab
View file @
bee19973
...
...
@@ -52,35 +52,35 @@ pipeline {
stage ("Analysis with cppcheck") {
steps {
gitlabCommitStatus(name: "Analysis with cppcheck") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck"
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck
--job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep
"
}
}
}
stage ("Build eNb-USRP") {
steps {
gitlabCommitStatus(name: "Build eNb-USRP") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp"
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp
--job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep
"
}
}
}
stage ("Build 5G gNB-USRP") {
steps {
gitlabCommitStatus(name: "Build gNb-usrp") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant gnb-usrp"
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant gnb-usrp
--job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep
"
}
}
}
stage ("Build 5G NR-UE-USRP") {
steps {
gitlabCommitStatus(name: "Build nr-UE-usrp") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant nu-ue-usrp"
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant nu-ue-usrp
--job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep
"
}
}
}
stage ("Build physical simulators") {
steps {
gitlabCommitStatus(name: "Build phy-sim") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim"
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim
--job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep
"
}
}
}
...
...
@@ -89,7 +89,7 @@ pipeline {
always {
script {
dir ('archives') {
sh "zip -r vm_build_logs.zip enb_usrp phy_sim cppcheck gnb_usrp nrue_usrp"
sh "zip -r
-qq
vm_build_logs.zip enb_usrp phy_sim cppcheck gnb_usrp nrue_usrp"
}
if(fileExists('archives/vm_build_logs.zip')) {
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
...
...
@@ -106,11 +106,18 @@ pipeline {
}
}
}
stage ("Destroy all Virtual Machines") {
steps {
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
post {
always {
script {
echo "End of script"
// Stage destroy may not be run if error in previous stage
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
success {
...
...
ci-scripts/buildOnVM.sh
View file @
bee19973
...
...
@@ -15,6 +15,12 @@ function usage {
echo
""
echo
"Options:"
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
" --workspace #### OR -ws ####"
echo
" Specify the workspace."
echo
""
...
...
@@ -47,7 +53,7 @@ function variant_usage {
echo
""
}
if
[
$#
-lt
1
]
||
[
$#
-gt
5
]
if
[
$#
-lt
1
]
||
[
$#
-gt
9
]
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
...
...
@@ -55,6 +61,9 @@ then
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
VM_NAME
=
ci-enb-usrp
ARCHIVES_LOC
=
enb_usrp
LOG_PATTERN
=
.Rel14.txt
...
...
@@ -204,6 +213,14 @@ then
exit
1
fi
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
VM_NAME
=
`
echo
$VM_NAME
|
sed
-e
"s#ci-#
$VM_TEMPLATE
#"
`
VM_CMDS
=
${
VM_NAME
}
_cmds.txt
ARCHIVES_LOC
=
${
JENKINS_WKSP
}
/archives/
${
ARCHIVES_LOC
}
...
...
ci-scripts/destroyAllRunningVM.sh
0 → 100644
View file @
bee19973
#!/bin/bash
function
usage
{
echo
"OAI VM Destroy script"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
"Usage:"
echo
"------"
echo
" destroyAllRunningVM.sh [OPTIONS]"
echo
""
echo
"Options:"
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
" --help OR -h"
echo
" Print this help message."
echo
""
}
if
[
$#
-gt
4
]
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
VM_TEMPLATE
=
ci-
JOB_NAME
=
XX
BUILD_ID
=
XX
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
shift
usage
exit
0
;;
-jn
|
--job-name
)
JOB_NAME
=
"
$2
"
shift
shift
;;
-id
|
--build-id
)
BUILD_ID
=
"
$2
"
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
done
if
[
"
$JOB_NAME
"
==
"XX"
]
||
[
"
$BUILD_ID
"
==
"XX"
]
then
VM_TEMPLATE
=
ci-
else
VM_TEMPLATE
=
${
JOB_NAME
}
-b
${
BUILD_ID
}
-
fi
LIST_CI_VM
=
`
uvt-kvm list |
grep
$VM_TEMPLATE
`
for
CI_VM
in
$LIST_CI_VM
do
VM_IP_ADDR
=
`
uvt-kvm ip
$CI_VM
`
echo
"VM to destroy:
$CI_VM
-- IP
$VM_IP_ADDR
"
uvt-kvm destroy
$CI_VM
ssh-keygen
-R
$VM_IP_ADDR
done
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment