1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vaultwarden_ynh.git synced 2024-09-03 18:26:31 +02:00

Move common code to _common.sh

This commit is contained in:
Salamandar 2023-12-03 12:08:34 +01:00
parent 00144b9f69
commit b350d66d37
3 changed files with 14 additions and 14 deletions

View file

@ -10,6 +10,17 @@ pkg_image="vaultwarden/server"
# PERSONAL HELPERS
#=================================================
_download_vaultwarden_from_docker() {
# Download, check integrity, uncompress the source of vaultwarden from app.src to his build directory
docker_arg=""
# Fixup for armhf
if [ $YNH_ARCH == "armhf" ]; then
docker_arg="--os_arch_variant=linux/arm/v7"
fi
ynh_docker_image_extract --dest_dir="$install_dir/build/" --image_spec="$pkg_image:$(ynh_app_upstream_version)" $docker_arg
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -29,13 +29,8 @@ ynh_app_setting_set --app=$app --key=admin_token --value=$admin_token
#=================================================
ynh_script_progression --message="Setting up source files..."
# Download, check integrity, uncompress and patch the source from app.src
docker_arg=""
if [ $YNH_ARCH == "armhf" ]
then
docker_arg="--os_arch_variant=linux/arm/v7"
fi
ynh_docker_image_extract --dest_dir="$install_dir/build/" --image_spec="$pkg_image:$(ynh_app_upstream_version)" $docker_arg
_download_vaultwarden_from_docker
mkdir -p "$install_dir/live/"
chmod 750 "$install_dir"

View file

@ -33,13 +33,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress the source of vaultwarden from app.src to his build directory
docker_arg=""
if [ $YNH_ARCH == "armhf" ]
then
docker_arg="--os_arch_variant=linux/arm/v7"
fi
ynh_docker_image_extract --dest_dir="$install_dir/build/" --image_spec="$pkg_image:$(ynh_app_upstream_version)" $docker_arg
_download_vaultwarden_from_docker
mkdir -p "$install_dir/live/"
fi