mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
We use git clone for install and upgrade (if relevant)
This commit is contained in:
parent
1740efd0a3
commit
665b12b81b
2 changed files with 33 additions and 1 deletions
|
@ -60,6 +60,10 @@ mkdir -p "$install_dir/cache/smarty3"
|
|||
chmod -R o-rwx "$install_dir"
|
||||
chmod -R 775 $install_dir/store $install_dir/cache
|
||||
|
||||
# Remember we use git clone to fetch code
|
||||
ynh_app_setting_set --app=$app --key=git_clone --value=1
|
||||
ynh_script_progression --message="We set git_clone value to $git_clone"
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -16,6 +16,8 @@ ynh_script_progression --message="Loading settings..." --weight=1
|
|||
|
||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
|
||||
ynh_app_setting_get --app=$app --key=git_clone
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
@ -56,8 +58,34 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir" --keep="store/ .htconfig.php php.log"
|
||||
# ynh_setup_source --dest_dir="$install_dir" --keep="store/ .htconfig.php php.log"
|
||||
|
||||
# First we save what we need to keep
|
||||
mv $install_dir/store $data_dir/
|
||||
mv $install_dir/cache $data_dir/
|
||||
mv $install_dir/php.log $data_dir/
|
||||
|
||||
# Then we remove the previous install
|
||||
ynh_secure_remove $install_dir
|
||||
|
||||
# We make the install cloning the repo
|
||||
mkdir -p "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
git config --system --add safe.directory $install_dir
|
||||
|
||||
git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet
|
||||
|
||||
# We restore what we previously saved
|
||||
mv $data_dir/store $install_dir/
|
||||
mv $data_dir/cache $install_dir/
|
||||
mv $data_dir/php.log $install_dir/
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chmod -R 775 $install_dir/store $install_dir/cache
|
||||
|
||||
# We add a little something to remember we now use git clone to fetch the app code
|
||||
ynh_app_setting_set --app=$app --key=git_clone --value=1
|
||||
fi
|
||||
|
||||
mkdir -p "$install_dir/store"
|
||||
|
|
Loading…
Add table
Reference in a new issue