Open ganeshmannamal opened 8 years ago
Here are the tests in dockup :
test "project_id is of the format org_name/repo_name/branch for github https url" do
id = Dockup.Project.project_id("https://github.com/code-mancers/dockup.git", "master")
assert id == "code-mancers/dockup/master"
end
test "project_id is of the format org_name/repo_name/branch for github ssh url" do
id = Dockup.Project.project_id("git@github.com:code-mancers/dockup.git", "master")
assert id == "code-mancers/dockup/master"
end
test "project_id is of the format org_name/repo_name/branch for gitlab ssh url" do
id = Dockup.Project.project_id("git@your_server.com:code-mancers/dockup.git", "master")
assert id == "code-mancers/dockup/master"
end
It should parse any valid git url
https://github.com/organization/app.git
https://repo_host.example.com/app.git
https://repo_host.example.com/project/app.git
https://example.com
http://github.com/app
(not ending with.git
)