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
Michael Black
OpenXG-RAN
Commits
05e7e3e0
Commit
05e7e3e0
authored
Jun 11, 2019
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix report problem, improve option flexibility
parent
13a079c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
30 deletions
+80
-30
ci-scripts/buildOnVM.sh
ci-scripts/buildOnVM.sh
+31
-18
ci-scripts/oai-ci-vm-tool
ci-scripts/oai-ci-vm-tool
+49
-12
No files found.
ci-scripts/buildOnVM.sh
View file @
05e7e3e0
...
@@ -35,26 +35,39 @@ function build_usage {
...
@@ -35,26 +35,39 @@ function build_usage {
echo
""
echo
""
echo
"Mandatory Options:"
echo
"Mandatory Options:"
echo
"--------"
echo
"--------"
echo
" --job-name #### OR -jn ####"
local
-A
HELP_BUILD
echo
" Specify the name of the Jenkins job."
HELP_BUILD[
"jn"
]=
" Specify the name of the Jenkins job."
echo
""
HELP_BUILD[
"id"
]=
" Specify the build ID of the Jenkins job."
echo
" --build-id #### OR -id ####"
HELP_BUILD[
"ws"
]=
" Specify the workspace"
echo
" Specify the build ID of the Jenkins job."
for
((
i
=
0
;
i<
${#
SHORT_OPTIONS
[@]
}
;
i++
))
echo
""
do
echo
" --workspace #### OR -ws ####"
if
[
$((
MANDATORY_OPTMASK
&
$((
2
**
$i
))
))
-ne
0
]
echo
" Specify the workspace."
then
echo
""
if
[
"
${
LONG_OPTIONS
[
$i
]
}
"
!=
""
]
then
printf
" %s #### OR "
"--
${
LONG_OPTIONS
[
$i
]
}
"
fi
printf
"%s ####
\n
"
"-
${
SHORT_OPTIONS
[
$i
]
}
"
printf
" %s
\n\n
"
"
${
HELP_BUILD
[
${
SHORT_OPTIONS
[
$i
]
}
]
}
"
fi
done
echo
"Options:"
echo
"Options:"
echo
"--------"
echo
"--------"
variant_usage
HELP_BUILD[
"var"
]=
" Specify the variant to build."
echo
" Specify the variant to build."
HELP_BUILD[
"k"
]=
" Keep the VM alive after the build."
echo
""
HELP_BUILD[
"D"
]=
" Run as daemon"
echo
" --keep-vm-alive OR -k"
for
((
i
=
0
;
i<
${#
SHORT_OPTIONS
[@]
}
;
i++
))
echo
" Keep the VM alive after the build."
do
echo
""
if
[
$((
ALLOWED_OPTMASK
&
$((
2
**
$i
))
))
-ne
0
]
echo
" --daemon OR -D"
then
echo
" Run as daemon"
if
[
"
${
LONG_OPTIONS
[
$i
]
}
"
!=
""
]
echo
""
then
printf
" %s #### OR "
"--
${
LONG_OPTIONS
[
$i
]
}
"
fi
printf
"%s ####
\n
"
"-
${
SHORT_OPTIONS
[
$i
]
}
"
printf
" %s
\n\n
"
"
${
HELP_BUILD
[
${
SHORT_OPTIONS
[
$i
]
}
]
}
"
fi
done
echo
" --help OR -h"
echo
" --help OR -h"
echo
" Print this help message."
echo
" Print this help message."
echo
""
echo
""
...
...
ci-scripts/oai-ci-vm-tool
View file @
05e7e3e0
...
@@ -186,14 +186,14 @@ function check_command_options {
...
@@ -186,14 +186,14 @@ function check_command_options {
if
[
$((
$GIVEN_OPTIONS
&
${
MANDATORY_OPTIONS
[0]
}
))
-ne
${
MANDATORY_OPTIONS
[0]
}
]
&&
[
$((
$GIVEN_OPTIONS
&
${
MANDATORY_OPTIONS
[1]
}
))
-ne
${
MANDATORY_OPTIONS
[1]
}
]
if
[
$((
$GIVEN_OPTIONS
&
${
MANDATORY_OPTIONS
[0]
}
))
-ne
${
MANDATORY_OPTIONS
[0]
}
]
&&
[
$((
$GIVEN_OPTIONS
&
${
MANDATORY_OPTIONS
[1]
}
))
-ne
${
MANDATORY_OPTIONS
[1]
}
]
then
then
echo
"Syntax Error: missing option(s) for
$4
command"
echo
"Syntax Error: missing option(s) for
$4
command"
$
4
_usage
$
{
4
//-/_
}
_usage
exit
1
exit
1
fi
fi
if
[
$((
$GIVEN_OPTIONS
|
${
MANDATORY_OPTIONS
[0]
}
|
${
MANDATORY_OPTIONS
[1]
}
|
$OPTIONAL_OPTIONS
))
-ne
$((
${
MANDATORY_OPTIONS
[0]
}
|
${
MANDATORY_OPTIONS
[1]
}
|
$OPTIONAL_OPTIONS
))
]
if
[
$((
$((
$GIVEN_OPTIONS
^
${
MANDATORY_OPTIONS
[0]
}))
|
$OPTIONAL_OPTIONS
))
-ne
$((
$OPTIONAL_OPTIONS
))
]
&&
[
$((
$((
$GIVEN_OPTIONS
^
${
MANDATORY_OPTIONS
[1]
}))
|
$OPTIONAL_OPTIONS
))
-ne
$((
$OPTIONAL_OPTIONS
))
]
then
then
echo
"Syntax Error: unknown option(s) for
$4
command"
echo
"Syntax Error: unknown option(s) for
$4
command"
$
4
_usage
$
{
4
//-/_
}
_usage
exit
1
exit
1
fi
fi
}
}
...
@@ -288,30 +288,67 @@ build_variant_arrays
...
@@ -288,30 +288,67 @@ build_variant_arrays
#variables to process options, for each option we define a variable to store
#variables to process options, for each option we define a variable to store
# its value and a bit mask, used to check allowed options depending on
# its value and a bit mask, used to check allowed options depending on
# the command
# the command
SHORT_OPTIONS=( "
jn
" "
id
" "
ws
" "
k
" "
D
" "
gu
" "
pu
" "
mr
" "
var
" "
notused
" "
sb
" "
sc
" "
tb
" "
tc
" "
br
" "
co
" "
epc
" )
LONG_OPTIONS=( "
job
-name
" "
build
-id
" "
workspace
" "
keep
-vm-alive
" "
daemon
" "
git
-url
" "" "" "
variant
" "
notused
" "" "" "" "" "" "" "" )
JOB_NAME=XX
JOB_NAME=XX
JOB_NAME_OPTINDEX=0
JOB_NAME_OPTID=1
JOB_NAME_OPTID=1
BUILD_ID=XX
BUILD_ID=XX
BUILD_ID_OPTINDEX=1
BUILD_ID_OPTID=2
BUILD_ID_OPTID=2
JENKINS_WKSP_OPTINDEX=2
JENKINS_WKSP_OPTID=4
JENKINS_WKSP_OPTID=4
KEEP_VM_ALIVE=0
KEEP_VM_ALIVE_OPTINDEX=3
KEEP_VM_ALIVE_OPTID=8
KEEP_VM_ALIVE_OPTID=8
RUN_OPTIONS="
none
"
KEEP_VM_ALIVE=0
DAEMON=0
DAEMON_OPTINDEX=4
DAEMON_OPTID=
$((
2
**
4
))
DAEMON_OPTID=
$((
2
**
4
))
DAEMON=0
GITURL_OPTINDEX=5
GITURL_OPTID=
$((
2
**
5
))
GITURL_OPTID=
$((
2
**
5
))
PU_OPTINDEX=6
PU_OPTID=
$((
2
**
6
))
PU_OPTID=
$((
2
**
6
))
PU_TRIG=0
MR_OPTINDEX=7
MR_OPTID=
$((
2
**
7
))
MR_OPTID=
$((
2
**
7
))
MR_TRIG=0
VARIANT_OPTINDEX=8
VARIANT_OPTID=
$((
2
**
8
))
VARIANT_OPTID=
$((
2
**
8
))
SB_OPTINDEX=10
SB_OPTID=
$((
2
**
10
))
SB_OPTID=
$((
2
**
10
))
SC_OPTINDEX=11
SC_OPTID=
$((
2
**
11
))
SC_OPTID=
$((
2
**
11
))
TB_OPTINDEX=12
TB_OPTID=
$((
2
**
12
))
TB_OPTID=
$((
2
**
12
))
TC_OPTINDEX=13
TC_OPTID=
$((
2
**
13
))
TC_OPTID=
$((
2
**
13
))
BR_OPTINDEX=14
BR_OPTID=
$((
2
**
14
))
BR_OPTID=
$((
2
**
14
))
CO_OPTINDEX=15
CO_OPTID=
$((
2
**
15
))
CO_OPTID=
$((
2
**
15
))
MR_TRIG=0
PU_TRIG=0
EPC_IPADDR_OPTINDEX=16
EPC_IPADDR=""
EPC_IPADDR_OPTID=
$((
2
**
16
))
EPC_IPADDR_OPTID=
$((
2
**
16
))
EPC_IPADDR=""
RUN_OPTIONS="
none
"
# list of variables that can be set via the --setvar option
# list of variables that can be set via the --setvar option
AUTHORIZED_VAR=("
VM_OSREL
RUN_EXPERIMENTAL
")
AUTHORIZED_VAR=("
VM_OSREL
RUN_EXPERIMENTAL
")
...
@@ -430,7 +467,7 @@ case $key in
...
@@ -430,7 +467,7 @@ case $key in
MANDATORY_OPTMASK[0]+=
$((
$GITURL_OPTID
+
$PU_OPTID
+
$BR_OPTID
+
$CO_OPTID
))
MANDATORY_OPTMASK[0]+=
$((
$GITURL_OPTID
+
$PU_OPTID
+
$BR_OPTID
+
$CO_OPTID
))
MANDATORY_OPTMASK[1]=
$((
$JOB_NAME_OPTID
+
$BUILD_ID_OPTID
+
$JENKINS_WKSP_OPTID
))
MANDATORY_OPTMASK[1]=
$((
$JOB_NAME_OPTID
+
$BUILD_ID_OPTID
+
$JENKINS_WKSP_OPTID
))
MANDATORY_OPTMASK[1]+=
$((
$GITURL_OPTID
+
$MR_OPTID
+
$SB_OPTID
+
$SC_OPTID
))
MANDATORY_OPTMASK[1]+=
$((
$GITURL_OPTID
+
$MR_OPTID
+
$SB_OPTID
+
$SC_OPTID
))
MANDATORY_OPTMASK[1]+=
$((
$
GITURL_OPTID
+
$
TB_OPTID
+
$TC_OPTID
))
MANDATORY_OPTMASK[1]+=
$((
$TB_OPTID
+
$TC_OPTID
))
shift
shift
;;
;;
-jn|--job-name)
-jn|--job-name)
...
@@ -534,7 +571,7 @@ case $key in
...
@@ -534,7 +571,7 @@ case $key in
shift
shift
shift
shift
;;
;;
-
-
epc)
-epc)
check_ipv4addr "
$2
"
check_ipv4addr "
$2
"
check_ipv4addr "
$3
"
check_ipv4addr "
$3
"
EPC_IPADDR="
$2
"
EPC_IPADDR="
$2
"
...
@@ -553,7 +590,7 @@ case $key in
...
@@ -553,7 +590,7 @@ case $key in
check_set_variant
${
key
//
"-"
}
check_set_variant
${
key
//
"-"
}
shift
shift
;;
;;
--variant)
-
var|-
-variant)
variant="
$2
"
variant="
$2
"
check_set_variant
${
2
}
check_set_variant
${
2
}
shift
shift
...
...
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