Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
e4290e34
Commit
e4290e34
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
riot upgrade
parent
af00fb49
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-riot
+48
-23
48 additions, 23 deletions
src/freedombone-app-riot
with
48 additions
and
23 deletions
src/freedombone-app-riot
+
48
−
23
View file @
e4290e34
...
...
@@ -117,8 +117,49 @@ function reconfigure_riot {
echo
-n
''
}
function
riot_download
{
# download
if
[
!
-f
$INSTALL_DIR
/
${
RIOT_FILENAME
}
.tar.gz
]
;
then
wget
${
RIOT_DOWNLOAD_URL
}
/
${
RIOT_FILENAME
}
.tar.gz
-O
$INSTALL_DIR
/
${
RIOT_FILENAME
}
.tar.gz
fi
if
[
!
-f
$INSTALL_DIR
/
${
RIOT_FILENAME
}
.tar.gz
]
;
then
echo
$'Unable to download Riot Web from releases'
exit
62836
fi
cd
$INSTALL_DIR
# check the hash
curr_hash
=
$(
sha256sum
${
RIOT_FILENAME
}
.tar.gz |
awk
-F
' '
'{print $1}'
)
if
[[
"
$curr_hash
"
!=
"
$RIOT_HASH
"
]]
;
then
echo
$'Riot download hash does not match'
exit
78352
fi
tar
-xzvf
${
RIOT_FILENAME
}
.tar.gz
if
[
!
-d
$INSTALL_DIR
/
${
RIOT_FILENAME
}
]
;
then
echo
$'Unable to extract Riot Web tarball'
exit
542826
fi
cp
-r
$INSTALL_DIR
/
${
RIOT_FILENAME
}
/
*
/var/www/
$RIOT_DOMAIN_NAME
/htdocs
chown
-R
www-data:www-data /var/www/
$RIOT_DOMAIN_NAME
/htdocs
}
function
upgrade_riot
{
set_repo_commit /var/www/
$RIOT_DOMAIN_NAME
/htdocs
"riot commit"
"
$RIOT_COMMIT
"
$RIOT_REPO
if
!
grep
-q
'riot version:'
$COMPLETION_FILE
;
then
return
fi
CURR_RIOT_VERSION
=
$(
get_completion_param
"riot version"
)
echo
"riot current version:
${
CURR_RIOT_VERSION
}
"
echo
"riot app version:
${
RIOT_VERSION
}
"
if
[[
"
${
CURR_RIOT_VERSION
}
"
==
"
${
RIOT_VERSION
}
"
]]
;
then
return
fi
riot_download
sed
-i
"s|riot version.*|riot version:
$RIOT_VERSION
|g"
${
COMPLETION_FILE
}
systemctl restart nginx
}
function
backup_local_riot
{
...
...
@@ -170,29 +211,8 @@ function install_riot {
mkdir
$INSTALL_DIR
fi
# download
if
[
!
-f
$INSTALL_DIR
/
${
RIOT_FILENAME
}
.tar.gz
]
;
then
wget
${
RIOT_DOWNLOAD_URL
}
/
${
RIOT_FILENAME
}
.tar.gz
-O
$INSTALL_DIR
/
${
RIOT_FILENAME
}
.tar.gz
fi
if
[
!
-f
$INSTALL_DIR
/
${
RIOT_FILENAME
}
.tar.gz
]
;
then
echo
$'Unable to download Riot Web from releases'
exit
62836
fi
cd
$INSTALL_DIR
# check the hash
curr_hash
=
$(
sha256sum
${
RIOT_FILENAME
}
.tar.gz |
awk
-F
' '
'{print $1}'
)
if
[[
"
$curr_hash
"
!=
"
$RIOT_HASH
"
]]
;
then
echo
$'Riot download hash does not match'
exit
78352
fi
riot_download
tar
-xzvf
${
RIOT_FILENAME
}
.tar.gz
if
[
!
-d
$INSTALL_DIR
/
${
RIOT_FILENAME
}
]
;
then
echo
$'Unable to extract Riot Web tarball'
exit
542826
fi
cp
-r
$INSTALL_DIR
/
${
RIOT_FILENAME
}
/
*
/var/www/
$RIOT_DOMAIN_NAME
/htdocs
cd
/var/www/
$RIOT_DOMAIN_NAME
/htdocs
cp
config.sample.json config.json
...
...
@@ -282,6 +302,11 @@ function install_riot {
systemctl restart nginx
set_completion_param
"riot domain"
"
$RIOT_DOMAIN_NAME
"
if
!
grep
-q
"riot version:"
${
COMPLETION_FILE
}
;
then
echo
"riot version:
${
RIOT_VERSION
}
"
>>
${
COMPLETION_FILE
}
else
sed
-i
"s|riot version.*|riot version:
${
RIOT_VERSION
}
|g"
${
COMPLETION_FILE
}
fi
APP_INSTALLED
=
1
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment