diff --git a/scripts/_common.sh b/scripts/_common.sh index ce03ddd..390cc61 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 #================================================= diff --git a/scripts/install b/scripts/install index 0dcd2ab..77d1c66 100644 --- a/scripts/install +++ b/scripts/install @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index 916e740..25eab9d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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