mirror of
https://github.com/YunoHost-Apps/scrumblr_ynh.git
synced 2024-09-03 20:16:29 +02:00
Create upgrade
This commit is contained in:
parent
ef76e7c9a5
commit
815df73bf4
1 changed files with 53 additions and 0 deletions
53
scripts/upgrade
Normal file
53
scripts/upgrade
Normal file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
# Load common variables and functions
|
||||
source ./_common.sh
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
path=$(ynh_app_setting_get "$app" path)
|
||||
is_public=$(ynh_app_setting_get "$app" is_public)
|
||||
|
||||
# Install the app
|
||||
|
||||
# Copy files to the right place
|
||||
final_path=/var/www/$app
|
||||
extract_source
|
||||
|
||||
# Files owned by root, www-data can just read
|
||||
sudo chown www-data:www-data $final_path -R
|
||||
sudo chmod 755 $final_path -R
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
nginxconf=/etc/nginx/conf.d/$domain.d/$app.conf
|
||||
sudo cp ../conf/nginx.conf $nginxconf
|
||||
sudo chown root: $nginxconf
|
||||
sudo chmod 600 $nginxconf
|
||||
pushd $final_path
|
||||
sudo npm install
|
||||
popd
|
||||
sudo service redis-server start
|
||||
sudo yunohost firewall allow Both 85
|
||||
pre_inst_scrumblr
|
||||
sudo service scrumblr start
|
||||
sudo systemctl start "$app".service
|
||||
|
||||
|
||||
|
||||
ynh_app_setting_set "$app" is_public "$is_public"
|
||||
if [ "$is_public" = 0 ];
|
||||
then
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
fi
|
||||
|
||||
sudo service nginx reload
|
||||
sudo yunohost service add "$app" --log /var/log/"$app"/"$app".log
|
||||
sudo yunohost app ssowatconf
|
||||
|
||||
# Start scrumblr
|
||||
sudo systemctl restart "$app".service
|
Loading…
Add table
Reference in a new issue