1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/friendica_ynh.git synced 2024-09-03 18:36:14 +02:00

Merge branch 'pr/56' into testing

This commit is contained in:
ericgaspar 2021-07-18 23:47:29 +02:00
commit 47551f2528
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 30 additions and 5 deletions

View file

@ -17,6 +17,7 @@
"code": "https://github.com/friendica/friendica"
},
"license": "AGPL-3.0-only",
"version": "2021.07~ynh1",
"maintainer": {
"name": "Anmol Sharma",
"email": ""

View file

@ -4,6 +4,11 @@
# COMMON VARIABLES
#=================================================
# commit hashes
# 2021.04
version_commit="d1d208f18b9b43916378ccfd09b963246fe631dd"
addons_version_commit="b164910032a620bd637574bd4b42423ff8c067bb"
# dependencies used by the app
YNH_PHP_VERSION="7.3"

View file

@ -77,14 +77,23 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
ynh_script_progression --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# 1 - Clone stable repo
ynh_exec_warn_less git clone https://github.com/friendica/friendica.git -b stable "$final_path"
git clone https://github.com/friendica/friendica.git -b stable "$final_path"
# Reset branch to the level of update we needed
pushd "$final_path"
git reset --hard $version_commit
popd
# Copy .htaccess-dist to ..htaccess
cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess"
# 2 - Clone addons repo
ynh_exec_warn_less git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
# Reset addons branch to the level of update we needed
pushd "$final_path/addon"
git reset --hard $addons_version_commit
popd
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
@ -142,7 +151,7 @@ ynh_store_file_checksum --file="$final_path/config/local.config.php"
# Run composer
pushd "$final_path"
php$phpversion bin/composer.phar install 2>/dev/null
php$phpversion bin/composer.phar install --no-dev
bin/console config system addon ldapauth
popd

View file

@ -111,11 +111,13 @@ then
git fetch
git checkout stable
git pull
git reset --hard $version_commit
popd
pushd "$final_path/addon"
git fetch
git checkout stable
git pull
git reset --hard $addons_version_commit
popd
# If git is not present upgrade through manual method
else
@ -130,12 +132,20 @@ else
# 1 - Clone stable repo
git clone https://github.com/friendica/friendica.git -b stable "$final_path"
# Reset branch to the level of update we needed
pushd "$final_path"
git reset --hard $version_commit
popd
# Remove the addon directory securely
ynh_secure_remove "$final_path/addon"
# 2 - Clone addons repo
git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon"
# Reset addons branch to the level of update we needed
pushd "$final_path/addon"
git reset --hard $addons_version_commit
popd
# Restore the smarty3 folder
cp -a "$tmpdir/view/smarty3" "$final_path/view/smarty3"