Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab FOSS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab FOSS
Commits
b4e1529e
There was a problem fetching the pipeline summary.
Commit
b4e1529e
authored
7 years ago
by
Alejandro Rodríguez
Browse files
Options
Downloads
Patches
Plain Diff
Reinstall shell on the test env if it's outdated
parent
e4eeba4e
No related branches found
No related tags found
Loading
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/initializers/5_backend.rb
+6
-4
6 additions, 4 deletions
config/initializers/5_backend.rb
spec/support/test_env.rb
+11
-8
11 additions, 8 deletions
spec/support/test_env.rb
with
17 additions
and
12 deletions
config/initializers/5_backend.rb
+
6
−
4
View file @
b4e1529e
required_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
version_required
)
current_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
new
.
version
)
unless
Rails
.
env
.
test?
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
warn
"WARNING: This version of GitLab depends on gitlab-shell
#{
required_version
}
, but you're running
#{
current_version
}
. Please update gitlab-shell."
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."
end
end
This diff is collapsed.
Click to expand it.
spec/support/test_env.rb
+
11
−
8
View file @
b4e1529e
...
...
@@ -120,18 +120,21 @@ def clean_gitlab_test_path
end
def
setup_gitlab_shell
unless
File
.
directory?
(
Gitlab
.
config
.
gitlab_shell
.
path
)
unless
system
(
'rake'
,
'gitlab:shell:install'
)
raise
'Can`t clone gitlab-shell'
end
shell_needs_update
=
component_needs_update?
(
Gitlab
.
config
.
gitlab_shell
.
path
,
Gitlab
::
Shell
.
version_required
)
unless
!
shell_needs_update
||
system
(
'rake'
,
'gitlab:shell:install'
)
raise
'Can`t clone gitlab-shell'
end
end
def
setup_gitaly
socket_path
=
Gitlab
::
GitalyClient
.
address
(
'default'
).
sub
(
/\Aunix:/
,
''
)
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"
end
...
...
@@ -261,13 +264,13 @@ def set_repo_refs(repo_path, branch_sha)
end
end
def
gitaly
_needs_update?
(
gitaly_dir
)
gitaly_
version
=
File
.
read
(
File
.
join
(
gitaly_di
r
,
'VERSION'
)).
strip
def
component
_needs_update?
(
component_folder
,
expected_version
)
version
=
File
.
read
(
File
.
join
(
component_folde
r
,
'VERSION'
)).
strip
# Notice that this will always yield true when using branch versions
# (`=branch_name`), but that actually makes sure the server is always based
# on the latest branch revision.
gitaly_
version
!=
Gitlab
::
GitalyClient
.
expected_
server_
version
version
!=
expected_version
rescue
Errno
::
ENOENT
true
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment