forked from aymhce/diaspora_ynh
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from YunoHost-Apps/testing
- Loading branch information
Showing
12 changed files
with
125 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
pkg_dependencies="build-essential cmake libssl-dev libcurl4-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql bison " | ||
ruby_build_dependencies="bison libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libyaml-dev pkg-config sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev libjemalloc-dev" | ||
|
||
pkg_dependencies="build-essential cmake libssl-dev libcurl4-openssl-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql bison " | ||
ruby_build_dependencies="bison libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libyaml-dev pkg-config sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev" | ||
current_tag="v0.7.14.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# some stuff we don't care about really. | ||
# clone ynh_experimental helpers | ||
pushd $final_path | ||
if [ -x Experimental_helpers ]; then | ||
pushd Experimental_helpers | ||
git fetch | ||
popd | ||
else | ||
git clone https://github.com/YunoHost-Apps/Experimental_helpers.git | ||
fi | ||
pushd Experimental_helpers | ||
git checkout 606b60cf6bb3906d32020392f0a824d1f9971e96 | ||
source ./ynh_install_ruby/ynh_install_ruby | ||
popd | ||
popd | ||
ynh_install_ruby --ruby_version=2.6.6 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
#================================================= | ||
|
||
# IMPORT GENERIC HELPERS | ||
source _common.sh | ||
source /usr/share/yunohost/helpers | ||
|
||
#================================================= | ||
|
@@ -20,17 +21,82 @@ domain=$(ynh_app_setting_get --app $app --key domain) | |
admin=$(ynh_app_setting_get --app $app --key admin) | ||
final_path=$(ynh_app_setting_get --app $app --key final_path) | ||
|
||
ynh_clean_setup() { | ||
ynh_clean_check_starting | ||
} | ||
ynh_abort_if_errors | ||
|
||
|
||
#================================================= | ||
# Check upgrade type | ||
#================================================= | ||
ynh_script_progression --message="Check upgrade type..." | ||
upgrade_type=$(ynh_check_app_version_changed) | ||
# nothing to do yet!! | ||
|
||
#================================================= | ||
# Stop services | ||
#================================================= | ||
ynh_script_progression --message="Stop services..." | ||
systemctl stop $app.target | ||
|
||
#================================================= | ||
# INSTALL DEPENDENCIES | ||
#================================================= | ||
ynh_script_progression --message="Installing dependencies..." | ||
ynh_install_app_dependencies $pkg_dependencies $ruby_build_dependencies | ||
|
||
#================================================= | ||
# ENSURE DOWNWARD COMPATIBILITY | ||
#================================================= | ||
# migrate from rvm to rbenv | ||
ynh_script_progression --message="Remove rvm..." | ||
if [ -e "$final_path/.rvm" ]; then | ||
sudo -u $app --login << EOF | ||
rvm implode --force | ||
EOF | ||
fi | ||
source ./install_ruby | ||
# remove old gpg keys for rvm | ||
ynh_script_progression --message="Remove old rvm keys..." | ||
if gpg --list-keys [email protected] >/dev/null 2>&1; then | ||
ynh_print_info --message="Found mpapis key: deleting" | ||
sudo -u $app gpg --delete-keys [email protected] | ||
ynh_secure_remove "$final_path/[email protected]" | ||
fi | ||
if gpg --list-keys [email protected] >/dev/null 2>&1; then | ||
ynh_print_info --message="Found piotr.kuczynski: deleting" | ||
sudo -u $app gpg --delete-keys [email protected] | ||
ynh_secure_remove "$final_path/[email protected]" | ||
fi | ||
|
||
if [ "$upgrade_type" == "UPGRADE_APP" ]; | ||
then | ||
upgrade_message="Upgrading this app and upstream to $current_tag" | ||
else | ||
upgrade_message="Shallow upgrade of yunohost app" | ||
fi | ||
ynh_script_progression --message=$upgrade_message | ||
if [ "$upgrade_type" == "UPGRADE_APP" ] | ||
then | ||
# do something! | ||
echo "to be implemented" | ||
# revert local change to .ruby-version | ||
pushd $final_path/diaspora | ||
git checkout -- .ruby-version | ||
git fetch | ||
git checkout $current_tag | ||
popd | ||
source ./bundle_app | ||
fi | ||
|
||
#================================================= | ||
# restart services | ||
#================================================= | ||
ynh_script_progression --message="Recreate and start services..." | ||
source ./create_services | ||
|
||
#================================================= | ||
# NGINX CONFIGURATION | ||
#================================================= | ||
# Create a dedicated nginx config | ||
ynh_script_progression --message="configure nginx..." --weight=1 | ||
ynh_add_nginx_config | ||
|
||
|