Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7044d649
Commit
7044d649
authored
Jun 03, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add autocrlf back to installation docs, add a check for it.
parent
5f7d6c7d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
doc/install/installation.md
doc/install/installation.md
+3
-0
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+31
-0
lib/tasks/gitlab/task_helpers.rake
lib/tasks/gitlab/task_helpers.rake
+2
-2
No files found.
doc/install/installation.md
View file @
7044d649
...
@@ -241,6 +241,9 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
...
@@ -241,6 +241,9 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Copy the example Rack attack config
# Copy the example Rack attack config
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
# Configure Git global settings for git user, used when editing via web editor
sudo -u git -H git config --global core.autocrlf input
# Configure Redis connection settings
# Configure Redis connection settings
sudo -u git -H cp config/resque.yml.example config/resque.yml
sudo -u git -H cp config/resque.yml.example config/resque.yml
...
...
lib/tasks/gitlab/check.rake
View file @
7044d649
...
@@ -13,6 +13,7 @@ namespace :gitlab do
...
@@ -13,6 +13,7 @@ namespace :gitlab do
warn_user_is_not_gitlab
warn_user_is_not_gitlab
start_checking
"GitLab"
start_checking
"GitLab"
check_git_config
check_database_config_exists
check_database_config_exists
check_database_is_not_sqlite
check_database_is_not_sqlite
check_migrations_are_up
check_migrations_are_up
...
@@ -37,6 +38,36 @@ namespace :gitlab do
...
@@ -37,6 +38,36 @@ namespace :gitlab do
# Checks
# Checks
########################
########################
def
check_git_config
print
"Git configured with autocrlf=input? ... "
options
=
{
"core.autocrlf"
=>
"input"
}
correct_options
=
options
.
map
do
|
name
,
value
|
run
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
config --global --get
#{
name
}
)
).
try
(
:squish
)
==
value
end
if
correct_options
.
all?
puts
"yes"
.
green
else
print
"Trying to fix Git error automatically. ..."
if
auto_fix_git_config
(
options
)
puts
"Success"
.
green
else
puts
"Failed"
.
red
try_fixing_it
(
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global core.autocrlf
\"
#{
options
[
"core.autocrlf"
]
}
\"
"
)
)
for_more_information
(
see_installation_guide_section
"GitLab"
)
end
end
end
def
check_database_config_exists
def
check_database_config_exists
print
"Database config exists? ... "
print
"Database config exists? ... "
...
...
lib/tasks/gitlab/task_helpers.rake
View file @
7044d649
...
@@ -118,9 +118,9 @@ namespace :gitlab do
...
@@ -118,9 +118,9 @@ namespace :gitlab do
# Returns true if all subcommands were successfull (according to their exit code)
# Returns true if all subcommands were successfull (according to their exit code)
# Returns false if any or all subcommands failed.
# Returns false if any or all subcommands failed.
def
auto_fix_git_config
(
options
)
def
auto_fix_git_config
(
options
)
if
!
@warned_user_not_gitlab
&&
options
[
'user.email'
]
!=
'example@example.com'
# default email should be overridden?
if
!
@warned_user_not_gitlab
command_success
=
options
.
map
do
|
name
,
value
|
command_success
=
options
.
map
do
|
name
,
value
|
system
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
config --global
#{
name
}
#{
value
}
)
)
system
(
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
config --global
#{
name
}
#{
value
}
)
)
end
end
command_success
.
all?
command_success
.
all?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment