1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mobilizon_ynh.git synced 2024-09-03 19:46:19 +02:00

Remove elixir

This commit is contained in:
ericgaspar 2021-12-23 09:08:37 +01:00
parent 6bb86dfa21
commit a2c646d04c
2 changed files with 6 additions and 29 deletions

View file

@ -6,9 +6,6 @@
# dependencies used by the app
pkg_dependencies="build-essential inotify-tools postgresql postgresql-client postgresql-contrib postgis postgresql-postgis-scripts git curl unzip gnupg openssl make gcc libc-dev argon2 imagemagick webp gifsicle jpegoptim optipng pngquant cmake"
extra_pkg_dependencies="elixir esl-erlang"
NODEJS_VERSION=14
#=================================================
# PERSONAL HELPERS

View file

@ -75,18 +75,6 @@ ynh_script_progression --message="Installing dependencies..."
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key='https://dl.yarnpkg.com/debian/pubkey.gpg'
if dpkg --compare-versions $(cat /etc/debian_version) ge 11.0
then
ynh_install_extra_app_dependencies --repo="deb http://packages.erlang-solutions.com/debian buster contrib" --package="$extra_pkg_dependencies" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc'
else
lsb_name="$(lsb_release --codename --short)"
ynh_install_extra_app_dependencies --repo="deb http://packages.erlang-solutions.com/debian $lsb_name contrib" --package="$extra_pkg_dependencies" --key='https://packages.erlang-solutions.com/debian/erlang_solutions.asc'
fi
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -160,22 +148,14 @@ ynh_script_progression --message="Installing dependencies and building app..." -
config="$final_path/live/config/runtime.exs"
pushd $final_path/live/js
ynh_use_nodejs
ynh_script_progression --message="Installing NodeJS dependencies (this is going to take a while...)"
ynh_exec_warn_less sudo -u $app env PATH=$PATH yarn install
ynh_script_progression --message="Building NodeJS application (this is going to take a while...)"
ynh_exec_warn_less sudo -u $app env PATH=$PATH NODE_BUILD_MEMORY=1024 yarn run build
popd
ynh_secure_remove --file="$final_path/live/js"
#ynh_secure_remove --file="$final_path/live/js"
ynh_script_progression --message="Building Elixir application (this is going to take a while...)"
pushd $final_path/live
sudo -u "$app" MIX_ENV=prod mix local.hex --force
sudo -u "$app" MIX_ENV=prod mix local.rebar --force
ynh_exec_warn_less sudo -u "$app" MIX_ENV=prod mix deps.get
ynh_exec_warn_less sudo -u "$app" MIX_ENV=prod mix compile
#sudo -u "$app" MIX_ENV=prod mix local.hex --force
#sudo -u "$app" MIX_ENV=prod mix local.rebar --force
#ynh_exec_warn_less sudo -u "$app" MIX_ENV=prod mix deps.get
#ynh_exec_warn_less sudo -u "$app" MIX_ENV=prod mix compile
sudo -u "$app" MIX_ENV=prod mix mobilizon.instance gen --force --output $config --output-psql /tmp/setup_db.psql --domain $domain --instance-name "Mobilizon" --admin-email "$app@$domain" --dbhost localhost --dbname $db_name --dbuser $db_user --dbpass $db_pwd --listen-port $port
popd
@ -193,7 +173,7 @@ pushd $final_path/live
ynh_replace_string --match_string="__YNH_USER__" --replace_string="${app}_notifs" --target_file="$config"
ynh_replace_string --match_string="__YNH_USER_PASSWORD__" --replace_string="${ynh_user_password}" --target_file="$config"
# Compile *again* because we added ldap conf in between... dunno if the first is relevant
sudo -u "$app" MIX_ENV=prod mix compile
#sudo -u "$app" MIX_ENV=prod mix compile
ynh_secure_remove --file="/tmp/setup_db.psql"
sudo -u "$app" MIX_ENV=prod mix ecto.migrate