Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #1844

Closed
Open
Created Oct 27, 2012 by Administrator@rootOwner

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

Assignee
Assign to
Time tracking