Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ActEV
diva_evaluation_cli
Commits
8ea72b12
Commit
8ea72b12
authored
Apr 02, 2019
by
Maxime Hubert
Browse files
get-system: add a new parameter called name
parent
22ec5279
Pipeline
#133758
passed with stage
in 31 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
diva_evaluation_cli/bin/commands/actev_get_system.py
View file @
8ea72b12
...
...
@@ -21,7 +21,7 @@ class ActevGetSystem(ActevCommand):
* user or U: username to access the url
* password or p: password to access the url
* token or t: token to access the url
* name or n: name to give to the system
"""
def
__init__
(
self
):
super
(
ActevGetSystem
,
self
).
__init__
(
'get-system'
,
entry_point
)
...
...
diva_evaluation_cli/bin/commands/actev_get_system_subcommands/archive_command.py
View file @
8ea72b12
...
...
@@ -16,6 +16,7 @@ class ActevGetSystemArchive(ActevCommand):
* user or U: url to get the system
* password or p: password to access the url
* token or t: token to access the url
* name or n: name to give to the system once it is downloaded
"""
def
__init__
(
self
):
...
...
@@ -36,5 +37,6 @@ class ActevGetSystemArchive(ActevCommand):
arg_parser
.
add_argument
(
"-l"
,
"--location"
,
help
=
"path to store the system"
)
arg_parser
.
add_argument
(
"-t"
,
"--token"
,
help
=
"token to access the url"
"Warning: if token starts with
\'
-
\'
, use this: --token=<your token>"
)
arg_parser
.
add_argument
(
"-n"
,
"--name"
,
help
=
"name to give to the system once it is downloaded"
)
diva_evaluation_cli/bin/commands/actev_get_system_subcommands/git_command.py
View file @
8ea72b12
...
...
@@ -17,7 +17,7 @@ class ActevGetSystemGit(ActevCommand):
* password or p: password to access the url
* token or t: token to access the url
* install-cli or i: install the cli to use it
* name or n: name to give to the system once it is downloaded
"""
def
__init__
(
self
):
super
(
ActevGetSystemGit
,
self
).
__init__
(
'git'
,
"get_git.sh"
)
...
...
@@ -39,5 +39,6 @@ class ActevGetSystemGit(ActevCommand):
"Warning: if token starts with
\'
-
\'
, use this: --token=<your token>"
,
type
=
str
)
arg_parser
.
add_argument
(
"-i"
,
"--install-cli"
,
help
=
"install the cli to use it"
,
action
=
'store_true'
)
arg_parser
.
add_argument
(
"-n"
,
"--name"
,
help
=
"name to give to the system once it is downloaded"
)
diva_evaluation_cli/bin/private_src/entry_points/actev_get_system.py
View file @
8ea72b12
...
...
@@ -5,7 +5,7 @@ This file should not be modified.
import
os
from
diva_evaluation_cli.bin.private_src.implementation.get_system.system_types_definition
import
system_types
def
entry_point
(
url
,
system_type
,
location
=
None
,
user
=
None
,
password
=
None
,
token
=
None
,
install_cli
=
False
):
def
entry_point
(
url
,
system_type
,
location
=
None
,
user
=
None
,
password
=
None
,
token
=
None
,
install_cli
=
False
,
name
=
False
):
"""Private entry point.
Downloads a credentialed, web-accessible content into src
...
...
@@ -37,6 +37,8 @@ def entry_point(url, system_type, location=None, user=None, password=None, token
install_cli
=
"True"
else
:
install_cli
=
"False"
if
not
name
:
name
=
""
# go into the right directory to execute the script
path
=
os
.
path
.
dirname
(
__file__
)
...
...
@@ -46,7 +48,8 @@ def entry_point(url, system_type, location=None, user=None, password=None, token
" "
+
user
+
\
" "
+
password
+
\
" "
+
token
+
\
" "
+
install_cli
" "
+
install_cli
+
\
" "
+
name
# execute the script
# status is the exit status code returned by the program
...
...
diva_evaluation_cli/bin/private_src/implementation/get_system/get/get_archive.sh
View file @
8ea72b12
...
...
@@ -5,6 +5,8 @@ location=$2
user
=
$3
password
=
$4
token
=
$5
install_cli
=
$6
name
=
$7
if
[
$location
!=
"None"
]
;
then
cd
$location
...
...
@@ -31,4 +33,9 @@ else
fi
archive
=
`
ls
`
python3.6
-c
"import shutil; shutil.unpack_archive('
${
archive
}
'); print('Archive uncompressed')"
if
[
$name
!=
""
]
;
then
python3.6
-c
"import shutil; shutil.unpack_archive('
${
archive
}
'); print('Archive uncompressed')"
else
python3.6
-c
"import shutil; shutil.unpack_archive('
${
archive
}
', '
${
name
}
'); print('Archive uncompressed')"
fi
diva_evaluation_cli/bin/private_src/implementation/get_system/get/get_git.sh
View file @
8ea72b12
...
...
@@ -6,6 +6,7 @@ user=$3
password
=
$4
token
=
$5
cli
=
$6
name
=
$7
# If there are credentials
if
[
$user
!=
"None"
]
&&
[
$password
!=
"None"
]
;
then
...
...
@@ -28,7 +29,7 @@ if [ $location != "None" ];then
cd
$location
fi
git clone
--recursive
$url
git clone
--recursive
$url
$name
if
[
$?
-eq
0
]
;
then
# If the system has to be installed
...
...
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