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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
c33ca9d8
Commit
c33ca9d8
authored
Nov 21, 2017
by
Alejandro Rodríguez
Committed by
Rémy Coutable
Nov 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `make install` for Gitaly setups in non-test environments
parent
4ebe6960
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
lib/tasks/gitlab/gitaly.rake
lib/tasks/gitlab/gitaly.rake
+8
-3
spec/tasks/gitlab/gitaly_rake_spec.rb
spec/tasks/gitlab/gitaly_rake_spec.rb
+9
-7
No files found.
lib/tasks/gitlab/gitaly.rake
View file @
c33ca9d8
...
...
@@ -14,8 +14,10 @@ namespace :gitlab do
checkout_or_clone_version
(
version:
version
,
repo:
args
.
repo
,
target_dir:
args
.
dir
)
command
=
%w[/usr/bin/env -u RUBYOPT -u BUNDLE_GEMFILE]
_
,
status
=
Gitlab
::
Popen
.
popen
(
%w[which gmake]
)
command
=
status
.
zero?
?
[
'gmake'
]
:
[
'make'
]
command
<<
(
status
.
zero?
?
'gmake'
:
'make'
)
command
<<
'BUNDLE_FLAGS=--no-deployment'
if
Rails
.
env
.
test?
...
...
@@ -23,7 +25,7 @@ namespace :gitlab do
create_gitaly_configuration
# In CI we run scripts/gitaly-test-build instead of this command
unless
ENV
[
'CI'
].
present?
Bundler
.
with_original_env
{
run_command!
(
%w[/usr/bin/env -u RUBYOPT -u BUNDLE_GEMFILE]
+
command
)
}
Bundler
.
with_original_env
{
run_command!
(
command
)
}
end
end
end
...
...
@@ -80,9 +82,12 @@ namespace :gitlab do
end
def
create_gitaly_configuration
File
.
open
(
"config.toml"
,
"w"
)
do
|
f
|
File
.
open
(
"config.toml"
,
File
::
WRONLY
|
File
::
CREAT
|
File
::
EXCL
)
do
|
f
|
f
.
puts
gitaly_configuration_toml
end
rescue
Errno
::
EEXIST
puts
"Skipping config.toml generation:"
puts
"A configuration file already exists."
rescue
ArgumentError
=>
e
puts
"Skipping config.toml generation:"
puts
e
.
message
...
...
spec/tasks/gitlab/gitaly_rake_spec.rb
View file @
c33ca9d8
...
...
@@ -47,7 +47,7 @@ describe 'gitlab:gitaly namespace rake task' do
stub_env
(
'CI'
,
false
)
FileUtils
.
mkdir_p
(
clone_path
)
expect
(
Dir
).
to
receive
(
:chdir
).
with
(
clone_path
).
and_call_original
allow
(
Bundler
).
to
receive
(
:bundle_path
).
and_return
(
'/fake/bundle_path'
)
allow
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
false
)
end
context
'gmake is available'
do
...
...
@@ -57,7 +57,7 @@ describe 'gitlab:gitaly namespace rake task' do
it
'calls gmake in the gitaly directory'
do
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen
).
with
(
%w[which gmake]
).
and_return
([
'/usr/bin/gmake'
,
0
])
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
%w[gmake
BUNDLE_FLAGS=--no-deployment
]
).
and_return
(
true
)
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
%w[gmake]
).
and_return
(
true
)
run_rake_task
(
'gitlab:gitaly:install'
,
clone_path
)
end
...
...
@@ -70,18 +70,20 @@ describe 'gitlab:gitaly namespace rake task' do
end
it
'calls make in the gitaly directory'
do
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
%w[make
BUNDLE_FLAGS=--no-deployment
]
).
and_return
(
true
)
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
%w[make]
).
and_return
(
true
)
run_rake_task
(
'gitlab:gitaly:install'
,
clone_path
)
end
context
'when Rails.env is not "test"'
do
context
'when Rails.env is test'
do
let
(
:command
)
{
%w[make BUNDLE_FLAGS=--no-deployment]
}
before
do
allow
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
fals
e
)
allow
(
Rails
.
env
).
to
receive
(
:test?
).
and_return
(
tru
e
)
end
it
'calls make in the gitaly directory with
out BUNDLE_PATH
'
do
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
[
'make'
]
).
and_return
(
true
)
it
'calls make in the gitaly directory with
--no-deployment flag for bundle
'
do
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
command
).
and_return
(
true
)
run_rake_task
(
'gitlab:gitaly:install'
,
clone_path
)
end
...
...
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