Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-09-11 12:04:58 +0400
committerMarin Jankovski <marin@gitlab.com>2014-09-11 12:06:56 +0400
commit09e64ae605914656e2b928dad0dce5df28b6f9a2 (patch)
treec43664b6892036181c3ec519d0ab30dd3648a824 /db/fixtures
parentd7ab859b911dba7a035ee67047ccd5cbd6e33c73 (diff)
Add an option to supply root password through an environmental variable.
Diffstat (limited to 'db/fixtures')
-rw-r--r--db/fixtures/production/001_admin.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/db/fixtures/production/001_admin.rb b/db/fixtures/production/001_admin.rb
index c00ba3c10ba..21c10f31923 100644
--- a/db/fixtures/production/001_admin.rb
+++ b/db/fixtures/production/001_admin.rb
@@ -1,9 +1,15 @@
+password = if ENV['GITLAB_ROOT_PASSWORD'].nil? || ENV['GITLAB_ROOT_PASSWORD'].empty?
+ "5iveL!fe"
+ else
+ ENV['GITLAB_ROOT_PASSWORD']
+ end
+
admin = User.create(
email: "admin@example.com",
name: "Administrator",
username: 'root',
- password: "5iveL!fe",
- password_confirmation: "5iveL!fe",
+ password: password,
+ password_confirmation: password,
password_expires_at: Time.now,
theme_id: Gitlab::Theme::MARS
@@ -19,6 +25,6 @@ puts %q[
Administrator account created:
login.........root
-password......5iveL!fe
+password......#{password}
]
end