1
0
Fork 0
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:
frju365 2017-02-11 20:02:49 +01:00 committed by GitHub
parent ef76e7c9a5
commit 815df73bf4

53
scripts/upgrade Normal file
View 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