summaryrefslogtreecommitdiff
path: root/db/fixtures/production/001_admin.rb
blob: 308b0528c9b1972fd25daf020df3bae35b8c390f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if ENV['GITLAB_ROOT_PASSWORD'].blank?
  password = '5iveL!fe'
  expire_time = Time.now
else
  password = ENV['GITLAB_ROOT_PASSWORD']
  expire_time = nil
end

email = ENV['GITLAB_ROOT_EMAIL'].presence || 'admin@example.com'

admin = User.create(
  email: email,
  name: "Administrator",
  username: 'root',
  password: password,
  password_expires_at: expire_time,
  theme_id: Gitlab::Themes::APPLICATION_DEFAULT

)

admin.projects_limit = 10000
admin.admin = true
admin.save!
admin.confirm

if admin.valid?
puts %Q[
Administrator account created:

login.........root
password......#{password}
]
end