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
a1500be1
Commit
a1500be1
authored
Apr 05, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Rake task from geo:add_primary_node to geo:set_primary_node
parent
c67abeaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lib/tasks/geo.rake
lib/tasks/geo.rake
+3
-3
spec/tasks/geo_rake_spec.rb
spec/tasks/geo_rake_spec.rb
+2
-2
No files found.
lib/tasks/geo.rake
View file @
a1500be1
...
...
@@ -74,7 +74,7 @@ namespace :geo do
end
desc
'Make this node the Geo primary'
task
:
add
_primary_node
,
[
:ssh_key_filename
]
=>
:environment
do
|
_
,
args
|
task
:
set
_primary_node
,
[
:ssh_key_filename
]
=>
:environment
do
|
_
,
args
|
filename
=
args
[
:ssh_key_filename
]
abort
'GitLab Geo is not supported with this license. Please contact sales@gitlab.com.'
unless
Gitlab
::
Geo
.
license_allows?
abort
'You must specify a filename of an SSH public key'
unless
filename
.
present?
...
...
@@ -84,7 +84,7 @@ namespace :geo do
abort
"Invalid SSH public key in
#{
filename
}
, aborting"
unless
public_key
add
_primary_geo_node
(
public_key
)
set
_primary_geo_node
(
public_key
)
end
def
load_ssh_public_key
(
filename
)
...
...
@@ -94,7 +94,7 @@ namespace :geo do
nil
end
def
add
_primary_geo_node
(
public_key
)
def
set
_primary_geo_node
(
public_key
)
params
=
{
host:
Gitlab
.
config
.
gitlab
.
host
,
port:
Gitlab
.
config
.
gitlab
.
port
,
relative_url_root:
Gitlab
.
config
.
gitlab
.
relative_url_root
,
...
...
spec/tasks/geo_rake_spec.rb
View file @
a1500be1
...
...
@@ -5,7 +5,7 @@ describe 'geo rake tasks' do
Rake
.
application
.
rake_require
'tasks/geo'
end
describe
'
add
_primary_node task'
do
describe
'
set
_primary_node task'
do
let
(
:ssh_key
)
{
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUkxk8m9rVYZ1q4/5xpg3TwTM9QFw3TinPFkyWsiACFKjor3byV6g3vHWTuIS70E7wk2JTXGL0wdrfUG6iQDJuP0BYNxjkluB14nIAfPuXN7V73QY/cqvHogw5o6pPRFD+Szke6FzouNQ70Z/qrM1k7me3e9DMuscMMrMTOR2HLKppNQyP4Jp0WJOyncdWB2NxKXTezy/ZnHv+BdhC0q0JW3huIx9qkBCHio7x8BdyJLMF9KxNYIuCkbP3exs5wgb+qGrjSri6LfAVq8dJ2VYibWxdsUG6iITJF+G4qbcyQjgiMLbxCfNd9bjwmkxSGvFn2EPsAFKzxyAvYFWb/y91 test@host'
}
before
do
...
...
@@ -21,7 +21,7 @@ describe 'geo rake tasks' do
expect
(
GeoNode
.
count
).
to
eq
(
0
)
run_rake_task
(
'geo:
add
_primary_node'
,
path
)
run_rake_task
(
'geo:
set
_primary_node'
,
path
)
expect
(
GeoNode
.
count
).
to
eq
(
1
)
node
=
GeoNode
.
first
...
...
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