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
Jérome Perrin
gitlab-ce
Commits
b4e1529e
Commit
b4e1529e
authored
Jun 19, 2017
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reinstall shell on the test env if it's outdated
parent
e4eeba4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
config/initializers/5_backend.rb
config/initializers/5_backend.rb
+6
-4
spec/support/test_env.rb
spec/support/test_env.rb
+11
-8
No files found.
config/initializers/5_backend.rb
View file @
b4e1529e
required_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
version_required
)
unless
Rails
.
env
.
test?
current_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
new
.
version
)
required_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
version_required
)
current_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
new
.
version
)
unless
current_version
.
valid?
&&
required_version
<=
current_version
unless
current_version
.
valid?
&&
required_version
<=
current_version
warn
"WARNING: This version of GitLab depends on gitlab-shell
#{
required_version
}
, but you're running
#{
current_version
}
. Please update gitlab-shell."
warn
"WARNING: This version of GitLab depends on gitlab-shell
#{
required_version
}
, but you're running
#{
current_version
}
. Please update gitlab-shell."
end
end
end
spec/support/test_env.rb
View file @
b4e1529e
...
@@ -120,18 +120,21 @@ module TestEnv
...
@@ -120,18 +120,21 @@ module TestEnv
end
end
def
setup_gitlab_shell
def
setup_gitlab_shell
unless
File
.
directory?
(
Gitlab
.
config
.
gitlab_shell
.
path
)
shell_needs_update
=
component_needs_update?
(
Gitlab
.
config
.
gitlab_shell
.
path
,
unless
system
(
'rake'
,
'gitlab:shell:install'
)
Gitlab
::
Shell
.
version_required
)
raise
'Can`t clone gitlab-shell'
end
unless
!
shell_needs_update
||
system
(
'rake'
,
'gitlab:shell:install'
)
raise
'Can`t clone gitlab-shell'
end
end
end
end
def
setup_gitaly
def
setup_gitaly
socket_path
=
Gitlab
::
GitalyClient
.
address
(
'default'
).
sub
(
/\Aunix:/
,
''
)
socket_path
=
Gitlab
::
GitalyClient
.
address
(
'default'
).
sub
(
/\Aunix:/
,
''
)
gitaly_dir
=
File
.
dirname
(
socket_path
)
gitaly_dir
=
File
.
dirname
(
socket_path
)
gitaly_needs_update
=
component_needs_update?
(
gitaly_dir
,
Gitlab
::
GitalyClient
.
expected_server_version
)
unless
!
gitaly_needs_update
?
(
gitaly_dir
)
||
system
(
'rake'
,
"gitlab:gitaly:install[
#{
gitaly_dir
}
]"
)
unless
!
gitaly_needs_update
||
system
(
'rake'
,
"gitlab:gitaly:install[
#{
gitaly_dir
}
]"
)
raise
"Can't clone gitaly"
raise
"Can't clone gitaly"
end
end
...
@@ -261,13 +264,13 @@ module TestEnv
...
@@ -261,13 +264,13 @@ module TestEnv
end
end
end
end
def
gitaly_needs_update?
(
gitaly_dir
)
def
component_needs_update?
(
component_folder
,
expected_version
)
gitaly_version
=
File
.
read
(
File
.
join
(
gitaly_di
r
,
'VERSION'
)).
strip
version
=
File
.
read
(
File
.
join
(
component_folde
r
,
'VERSION'
)).
strip
# Notice that this will always yield true when using branch versions
# Notice that this will always yield true when using branch versions
# (`=branch_name`), but that actually makes sure the server is always based
# (`=branch_name`), but that actually makes sure the server is always based
# on the latest branch revision.
# on the latest branch revision.
gitaly_version
!=
Gitlab
::
GitalyClient
.
expected_server
_version
version
!=
expected
_version
rescue
Errno
::
ENOENT
rescue
Errno
::
ENOENT
true
true
end
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