From 84eb332ef8c8df40cf690676bfe8b21a22757515 Mon Sep 17 00:00:00 2001 From: tytan652 <17492366+tytan652@users.noreply.github.com> Date: Thu, 22 Aug 2019 10:38:11 +0200 Subject: [PATCH] docs: add comments to install and upgrade scripts --- scripts/install | 10 ++++++++-- scripts/upgrade | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index d0ff4ba..ca5b7f8 100644 --- a/scripts/install +++ b/scripts/install @@ -84,8 +84,11 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# Download, check integrity, uncompress and patch the source from app.src + +# Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory ynh_setup_source --dest_dir="$final_path/build/" --source_id=app + +# Download, check integrity, uncompress and patch the source from web.src ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web #================================================= @@ -114,19 +117,22 @@ ynh_script_progression --message="Making install..." --weight=780 # Set right permissions chown -R "$app":"$app" $final_path -# Install +# Install rustup pushd $final_path sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" +# Compile bitwarden_rs pushd $final_path/build sudo -u "$app" env PATH=$PATH cargo build --release popd +# Install bitwarden_rs cp -a $final_path/build/target/release/. $final_path/live/. +# Remove build files and rustup ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$final_path/.cargo" ynh_secure_remove --file="$final_path/.rustup" diff --git a/scripts/upgrade b/scripts/upgrade index a00bf2e..32c63af 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,8 +84,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=6 - # Download, check integrity, uncompress and patch the source from app.src + # Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory ynh_setup_source --dest_dir="$final_path/build/" --source_id=app + + # Download, check integrity, uncompress and patch the source from web.src ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web fi @@ -124,19 +126,22 @@ chown -R "$app":"$app" $final_path if [ "$upgrade_type" == "UPGRADE_APP" ] then - # Install + # Install rustup pushd $final_path sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" + # Compile bitwarden_rs pushd $final_path/build sudo -u "$app" env PATH=$PATH cargo build --release popd + # Install bitwarden_rs cp -a $final_path/build/target/release/. $final_path/live/. + # Remove build files and rustup ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$final_path/.cargo" ynh_secure_remove --file="$final_path/.rustup"