Commit 0a8785f2 authored by Baptiste CHOCOT's avatar Baptiste CHOCOT
Browse files

Merge branch 'dev_archivefix' into 'master'

get-system archive fixes

See merge request !73
parents 9ae16e9a 19c4e83e
Pipeline #230594 passed with stages
in 8 minutes and 3 seconds
......@@ -91,7 +91,7 @@ def entry_point(url, system_type, location=None, user=None, password=None,
script += " " + url + \
" " + location + \
" " + user + \
" " + password + \
" " + password.replace('#', '\\#') + \
" " + token + \
" " + install_cli + \
" " + sha + \
......
......@@ -5,10 +5,11 @@ location=$2
user=$3
password=$4
token=$5
install_cli=$6
name=$7
install_cli=$6 # not used
sha=$7 # not used
name=$8
if [ $location != "None" ];then
if [[ $location != "None" ]];then
cd $location
fi
......@@ -18,13 +19,13 @@ mkdir "./$archive_dir"
cd "./$archive_dir"
options="-O -J -L"
if [ $token != "None" ]; then
curl "Authorization: Bearer $token" $options $url
if [[ "$token" != "None" ]]; then
curl -H "Authorization: Bearer $token" $options $url
else
if [ $user != "None" ] && [ $password != "None" ];then
if [[ $user != "None" ]] && [[ $password != "None" ]];then
curl $options -u $user:$password $url
else
if [ $user != "None" ] && [ $password == "None" ];then
if [[ $user != "None" ]] && [[ $password == "None" ]];then
curl $options -u $user $url
else
curl $options $url
......@@ -34,12 +35,15 @@ fi
archive=`ls`
python3 -c "import shutil; shutil.unpack_archive('${archive}'); print('Archive uncompressed')"
if [[ $? -ne 0 ]]; then
exit 1
fi
rm $archive
package=`ls`
if [ $name != "" ] && [ $name != $package ]; then
if [[ "$name" != "None" ]] && [[ $name != $package ]]; then
mv $package $name
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment