Commit 5dfab4ce authored by Lin Jen-Shin's avatar Lin Jen-Shin

Unify the use of repository_location

parent fb758c75
......@@ -23,7 +23,7 @@ module QA
Git::Repository.perform do |repository|
repository.location = Page::Project::Show.act do
choose_repository_clone_http
repository_location
repository_location.git_uri
end
repository.use_default_credentials
......
......@@ -17,10 +17,10 @@ module QA
Page::Project::Show.act { project_name }
end
product :repository_ssh_uri do
product :repository_ssh_location do
Page::Project::Show.act do
choose_repository_clone_ssh
repository_location_uri
repository_location
end
end
......
......@@ -33,11 +33,7 @@ module QA
end
def repository_location
find('#project_clone').value
end
def repository_location_uri
Git::Location.new(repository_location)
Git::Location.new(find('#project_clone').value)
end
def project_name
......@@ -74,7 +70,7 @@ module QA
end
# Ensure git clone textbox was updated
repository_location.include?(detect_text)
repository_location.git_uri.include?(detect_text)
end
end
end
......
......@@ -16,7 +16,7 @@ module QA
resource.name = 'deploy-key-clone-project'
end
@repository_uri = @project.repository_ssh_uri
@repository_location = @project.repository_ssh_location
Factory::Resource::Runner.fabricate! do |resource|
resource.project = @project
......@@ -60,11 +60,11 @@ module QA
cat-config:
script:
- mkdir -p ~/.ssh
- ssh-keyscan -p #{@repository_uri.port} #{@repository_uri.host} >> ~/.ssh/known_hosts
- ssh-keyscan -p #{@repository_location.port} #{@repository_location.host} >> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add -D
- echo "$#{deploy_key_name}" | ssh-add -
- git clone #{@repository_uri.git_uri}
- git clone #{@repository_location.git_uri}
- cd #{@project.name}
- git checkout #{deploy_key_name}
- sha1sum .gitlab-ci.yml
......
......@@ -4,7 +4,7 @@ module QA
given(:location) do
Page::Project::Show.act do
choose_repository_clone_http
repository_location
repository_location.git_uri
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment