Commit 04f84fc5 authored by Spctrl's avatar Spctrl

change how git checks out correct version

parent 01f04e7c
......@@ -75,3 +75,5 @@ ynh_print_info "Backing up systemd configuration"
systemd_location=/usr/lib/systemd/system
ynh_backup "$systemd_location/$app.service"
ynh_print_info "Finalising backup"
......@@ -124,7 +124,7 @@ ynh_print_info "Building the Pleroma instance"
chown -R $app: $final_path
su - $app -c "cd $final_path/pleroma;git checkout $new_version;mix local.hex --force;mix deps.get;mix local.rebar --force;mix pleroma.instance gen --domain "$domain" --instance-name "$server_name" --admin-email "$email" --dbhost localhost --dbname "$db_name" --dbuser "$app" --dbpass "$(ynh_string_random 32)";cp config/generated_config.exs config/prod.secret.exs;"
su - $app -c "cd $final_path/pleroma;git checkout master;git checkout tags/$new_version;mix local.hex --force;mix deps.get;mix local.rebar --force;mix pleroma.instance gen --domain "$domain" --instance-name "$server_name" --admin-email "$email" --dbhost localhost --dbname "$db_name" --dbuser "$app" --dbpass "$(ynh_string_random 32)";cp config/generated_config.exs config/prod.secret.exs;"
# Check that there are no unreplaced variables in the generated config files
cat $final_path/pleroma/config/generated_config.exs | grep "<%= .* %>" && ynh_die "$final_path/pleroma/config/generated_config.exs has unset variables"
......
......@@ -130,7 +130,7 @@ systemctl stop $app
# First we revert to the last commit, untracked files are save from this. Then we pull, I added --no-edit just to be sure.
# Then we checkout the new version and do some Pleroma magic.
# TODO: Keep track of reverted files instead of hard reset everything
su - $app -c "cd $final_path/pleroma;git reset --hard;git pull --no-edit;git checkout $new_version;MIX_ENV=prod mix deps.get;MIX_ENV=prod mix ecto.migrate;"
su - $app -c "cd $final_path/pleroma;git reset --hard;git fetch --all --tags --prune;git checkout master;git checkout tags/$new_version;mix local.hex --force;MIX_ENV=prod mix deps.get;MIX_ENV=prod mix ecto.migrate;"
#=================================================
# RESTART PLEROMA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment