Commit 9ef977db authored by Spctrl's avatar Spctrl

upgrade: add git reset --hard in case of uncommited tracked files

parent 453ba455
......@@ -43,15 +43,15 @@ ynh_abort_if_errors
ynh_print_info "Ensuring backwards compatibility"
# Pleroma sets the headers so we don't need to do it
# TODO: The following lines seems to break the whole thing. First make it work on install, then check this out.
## Pleroma sets the headers so we don't need to do it
#if (cat "/etc/nginx/conf.d/$domain.d/$app.conf" | grep 'add_header')
#then
# TODO: The following lines seems to break the whole thing. First make it work on install, then check this out.
#cp -rf "../conf/nginx.conf" "/etc/nginx/conf.d/$domain.d/$app.conf"
#ynh_replace_string "{APP}" "$app" "/etc/nginx/conf.d/$domain.d/$app.conf"
#ynh_replace_string "{PORT}" "$port" "/etc/nginx/conf.d/$domain.d/$app.conf"
#ynh_replace_string "add_header" "# add_header" "/etc/nginx/conf.d/$domain.conf"
#systemctl reload nginx
# cp -rf "../conf/nginx.conf" "/etc/nginx/conf.d/$domain.d/$app.conf"
# ynh_replace_string "{APP}" "$app" "/etc/nginx/conf.d/$domain.d/$app.conf"
# ynh_replace_string "{PORT}" "$port" "/etc/nginx/conf.d/$domain.d/$app.conf"
# ynh_replace_string "add_header" "# add_header" "/etc/nginx/conf.d/$domain.conf"
# systemctl reload nginx
#fi
#=================================================
......@@ -65,8 +65,9 @@ ynh_print_info "Doing actual upgrade"
new_branch="v0.9.9"
systemctl stop $app
# TODO: This will have to move to the new stable branch as well
su - $app -c "cd $final_path/pleroma;git pull --no-edit;git checkout $new_branch;MIX_ENV=prod mix deps.get;MIX_ENV=prod mix ecto.migrate;"
# 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.
su - $app -c "cd $final_path/pleroma;git reset --hard;git pull --no-edit;git checkout $new_branch;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