Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neutrinet_cube_install
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Neutrinet
neutrinet_cube_install
Commits
6af726e9
Commit
6af726e9
authored
May 09, 2020
by
HgO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade yunocube scripts and rebuild Yunohost image
parent
8ffbf169
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
13 deletions
+38
-13
neutrinet_cube_install.sh
neutrinet_cube_install.sh
+38
-13
No files found.
neutrinet_cube_install.sh
View file @
6af726e9
...
...
@@ -727,23 +727,28 @@ function download_image() {
mkdir
-p
"
$CUBE_RESOURCES_LOCATION
"
pushd
"
$CUBE_RESOURCES_LOCATION
"
>
/dev/null
local
cube_build_script_enabled
=
false
debug
$"Finding latest Yunohost
$board
image..."
ynh_image_zip
=
"
$(
curl
--show-error
--fail
--silent
$YNH_IMG_LOCATION
\
local
ynh_image_zip
=
"
$(
curl
--show-error
--fail
--silent
$YNH_IMG_LOCATION
\
|
grep
"
${
YUNOHOST_PREFIX
}
-
${
DEBIAN_CODENAME
}
-[
\d\.
]+-
$board
-stable.img.zip"
-Po
\
|
sort
-V
\
|
tail
-n
1
)
"
ynh_image_sum
=
"
$ynh_image_zip
.sha256sum"
ynh_image_sig
=
"
$ynh_image_zip
.sig"
local
ynh_image_sum
=
"
$ynh_image_zip
.sha256sum"
local
ynh_image_sig
=
"
$ynh_image_zip
.sig"
local
version
=
$(
cut
-d
'-'
-f
3
<<<
$ynh_image_zip
)
version
=
$(
cut
-d
'-'
-f
3
<<<
$ynh_image_zip
)
info
$"Latest Yunohost
$board
image is v
$version
!"
ynh_image
=
"
${
YUNOHOST_PREFIX
}
-
${
DEBIAN_CODENAME
}
-
${
version
}
-
${
board
}
-stable.img"
local
ynh_image
=
"
${
YUNOHOST_PREFIX
}
-
${
DEBIAN_CODENAME
}
-
${
version
}
-
${
board
}
-stable.img"
# The image path is used globally
image
=
"
${
ynh_image
/
${
YUNOHOST_PREFIX
}
/
${
INTERNETCUBE_PREFIX
}}
"
if
[[
!
-f
$image
]]
then
cube_build_script_enabled
=
true
if
[[
!
-f
$ynh_image
]]
then
if
[[
!
-f
$ynh_image_zip
]]
...
...
@@ -767,27 +772,47 @@ function download_image() {
unzip
-p
"
$ynh_image_zip
"
>
"
$ynh_image
"
rm
"
$ynh_image_zip
"
fi
fi
if
[[
!
-f
$CUBE_BUILD_SCRIPT_NAME
]]
if
[[
!
-d
$CUBE_BUILD_SCRIPT_DIR
]]
then
info
$"Downloading internetcube scripts..."
git clone
-q
${
CUBE_BUILD_SCRIPT_LOCATION
}
${
CUBE_BUILD_SCRIPT_DIR
}
>
/dev/null
cube_build_script_enabled
=
true
else
local
cube_build_script_current_revision
if
[[
$CUBE_BUILD_SCRIPT_REVISION
!=
"master"
]]
then
cube_build_script_current_revision
=
$(
git
-C
$CUBE_BUILD_SCRIPT_DIR
rev-parse HEAD
)
fi
if
[[
$cube_build_script_current_revision
!=
$CUBE_BUILD_SCRIPT_REVISION
]]
then
info
$"Downloading internetcube scripts..."
git clone
-q
${
CUBE_BUILD_SCRIPT_LOCATION
}
${
CUBE_BUILD_SCRIPT_DIR
}
>
/dev/null
git
-C
${
CUBE_BUILD_SCRIPT_DIR
}
checkout
-q
${
CUBE_BUILD_SCRIPT_REVISION
}
>
/dev/null
info
$"Upgrading internetcube scripts..."
git
-C
${
CUBE_BUILD_SCRIPT_DIR
}
remote set-url origin
${
CUBE_BUILD_SCRIPT_LOCATION
}
git
-C
${
CUBE_BUILD_SCRIPT_DIR
}
fetch
cube_build_script_enabled
=
true
fi
fi
if
[[
$cube_build_script_enabled
==
true
]]
then
git
-C
${
CUBE_BUILD_SCRIPT_DIR
}
checkout
-q
${
CUBE_BUILD_SCRIPT_REVISION
}
>
/dev/null
debug
$"Building internetcube image..."
info
$"Building internetcube image..."
check_sudo
sudo chmod
u+x
$CUBE_BUILD_SCRIPT_NAME
if
!
sudo
"./
$CUBE_BUILD_SCRIPT_NAME
"
"
$ynh_image
"
;
then
if
!
sudo
"./
$CUBE_BUILD_SCRIPT_NAME
"
"
$ynh_image
"
then
# when the script fails, ensure that there isn't any corrupted built image left behind
rm
-f
"
$image
"
return
1
fi
rm
-rf
"
$CUBE_BUILD_SCRIPT_DIR
"
"
tmp"
rm
-rf
"tmp"
fi
info
$"We've got our internetcube image!"
popd
>
/dev/null
...
...
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