diff --git a/scripts/install b/scripts/install index 244dc09..cc4e514 100755 --- a/scripts/install +++ b/scripts/install @@ -158,13 +158,14 @@ chown -R $app: $final_path # App settings -( cd $final_path && sudo -u "$app" curl -sf -L https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly --date=2018-07-17 ) - export PATH="$PATH:/var/www/$app/.cargo/bin:/var/$app/.local/bin:/usr/local/sbin" +( cd $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' ) +PATH="$PATH:/var/www/$app/.cargo/bin" + export PATH="$PATH:/var/www/$app/.cargo/bin:/usr/local/sbin" export FEATURES=postgres -( cd $final_path/$app && sudo -u "$app" cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0' ) +( cd $final_path/$app && sudo -u "$app" /var/www/$app/.cargo/bin/cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0' ) ( cd $final_path/$app && diesel migration run ) -( cd $final_path/$app && sudo -u "$app" cargo install --no-default-features --features postgres ) -( cd $final_path/$app && sudo -u "$app" cargo install --no-default-features --features postgres --path plume-cli ) +( cd $final_path/$app && sudo -u "$app" /var/www/$app/.cargo/bin/cargo install --no-default-features --features postgres ) +( cd $final_path/$app && sudo -u "$app" /var/www/$app/.cargo/bin/cargo install --no-default-features --features postgres --path plume-cli ) # Add new instance if [ $registration -eq 1 ] @@ -177,6 +178,9 @@ fi # Add admin user ( cd $final_path/$app && sudo -u "$app" /var/www/$app/.cargo/bin/plm users new --admin -n "$admin" -N "$admin" --email "$admin_email" --password "$admin_pass" ) +# Initialise search index +( cd $final_path/$app && sudo -u "$app" /var/www/$app/.cargo/bin/plm search init -p $final_path/$app ) + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/remove b/scripts/remove index cacc8de..ebae61d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -49,7 +49,7 @@ fi ynh_remove_app_dependencies export PATH="$PATH:/var/www/$app/.cargo/bin:/var/$app/.local/bin:/usr/local/sbin" export FEATURES=postgres -( cd $final_path/$app && sudo -u "$app" cargo uninstall diesel_cli ) +( cd $final_path/$app && sudo -u "$app" /var/www/$app/.cargo/bin/cargo uninstall diesel_cli ) if [ -d "/usr/local/lib/rustlib" ]; then sudo /usr/local/lib/rustlib/uninstall.sh