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 ...@@ -23,7 +23,7 @@ module QA
Git::Repository.perform do |repository| Git::Repository.perform do |repository|
repository.location = Page::Project::Show.act do repository.location = Page::Project::Show.act do
choose_repository_clone_http choose_repository_clone_http
repository_location repository_location.git_uri
end end
repository.use_default_credentials repository.use_default_credentials
......
...@@ -17,10 +17,10 @@ module QA ...@@ -17,10 +17,10 @@ module QA
Page::Project::Show.act { project_name } Page::Project::Show.act { project_name }
end end
product :repository_ssh_uri do product :repository_ssh_location do
Page::Project::Show.act do Page::Project::Show.act do
choose_repository_clone_ssh choose_repository_clone_ssh
repository_location_uri repository_location
end end
end end
......
...@@ -33,11 +33,7 @@ module QA ...@@ -33,11 +33,7 @@ module QA
end end
def repository_location def repository_location
find('#project_clone').value Git::Location.new(find('#project_clone').value)
end
def repository_location_uri
Git::Location.new(repository_location)
end end
def project_name def project_name
...@@ -74,7 +70,7 @@ module QA ...@@ -74,7 +70,7 @@ module QA
end end
# Ensure git clone textbox was updated # Ensure git clone textbox was updated
repository_location.include?(detect_text) repository_location.git_uri.include?(detect_text)
end end
end end
end end
......
...@@ -16,7 +16,7 @@ module QA ...@@ -16,7 +16,7 @@ module QA
resource.name = 'deploy-key-clone-project' resource.name = 'deploy-key-clone-project'
end end
@repository_uri = @project.repository_ssh_uri @repository_location = @project.repository_ssh_location
Factory::Resource::Runner.fabricate! do |resource| Factory::Resource::Runner.fabricate! do |resource|
resource.project = @project resource.project = @project
...@@ -60,11 +60,11 @@ module QA ...@@ -60,11 +60,11 @@ module QA
cat-config: cat-config:
script: script:
- mkdir -p ~/.ssh - 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) - eval $(ssh-agent -s)
- ssh-add -D - ssh-add -D
- echo "$#{deploy_key_name}" | ssh-add - - echo "$#{deploy_key_name}" | ssh-add -
- git clone #{@repository_uri.git_uri} - git clone #{@repository_location.git_uri}
- cd #{@project.name} - cd #{@project.name}
- git checkout #{deploy_key_name} - git checkout #{deploy_key_name}
- sha1sum .gitlab-ci.yml - sha1sum .gitlab-ci.yml
......
...@@ -4,7 +4,7 @@ module QA ...@@ -4,7 +4,7 @@ module QA
given(:location) do given(:location) do
Page::Project::Show.act do Page::Project::Show.act do
choose_repository_clone_http choose_repository_clone_http
repository_location repository_location.git_uri
end end
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