Provide a script/setup

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Copied from https://gitlab.com/gitlab-org/gitlab-ce/issues/28508#note_23937996.

We can have the same script/setup as https://github.com/github/scripts-to-rule-them-all/blob/master/script/setup but with bin/rake db:create and bin/rake db:dev:setup.

Also note gdk/support/bootstrap-rails which should really be moved to script/setup (following https://github.com/github/scripts-to-rule-them-all#scriptsetup) while we're at it:

#!/usr/bin/env ruby

success = true
begin
  foreman_pid = spawn('./run', 'db')
  [
    %W(bundle exec rake db:create),
    %W(bundle exec rake dev:setup),
  ].each do |cmd|
    success &&= system({'force' => 'yes', 'BOOTSTRAP' => '1'}, *cmd, chdir: 'gitlab')
  end
ensure
  Process.kill('TERM', foreman_pid)
end

Process.wait(foreman_pid)

exit true if success

abort "#$0 failed"

Note: ENV['BOOTSTRAP'] is used in config/environments/development.rb: config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1')

Edited Sep 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading