diff --git a/manifest.json b/manifest.json index 17f0952..2445eda 100644 --- a/manifest.json +++ b/manifest.json @@ -17,6 +17,7 @@ "code": "https://github.com/friendica/friendica" }, "license": "AGPL-3.0-only", + "version": "2021.07~ynh1", "maintainer": { "name": "Anmol Sharma", "email": "" diff --git a/scripts/_common.sh b/scripts/_common.sh index bb74e80..964106a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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" diff --git a/scripts/install b/scripts/install index 561457a..188f8fa 100644 --- a/scripts/install +++ b/scripts/install @@ -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" + +# 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 # 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 diff --git a/scripts/upgrade b/scripts/upgrade index 70e1c07..0ec6dfe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 @@ -128,14 +130,22 @@ else # Remove the app directory securely ynh_secure_remove "$final_path" - # 1- Clone stable repo + # 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"