Setup task destroys database without warning
Created by: williscool
As is running
sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production
will drop the database and start everything a new. without warning.
I propose something to the effect of
namespace :gitlab do
namespace :app do
unless ENV['IGNORE_AND_DESTROY_DATA_ANYWAY'] == "yes"
announce "WARNING THIS SETUP TASK WILL DESTROY YOUR DATABASE and start anew"
fail "Usage: IGNORE_AND_DESTROY_DATA_ANYWAY=yes bundle exec rake gitlab:app:setup RAILS_ENV=production "
end
desc "GITLAB | Setup production application"
task :setup => [
'db:setup',
'db:seed_fu',
'gitlab:app:enable_automerge'
]
end
end
Luckily for me I did this before I put anything in there I really cared about. Some other poor soul might not be so lucky