dockup / chatops_deployer

Automated staging environments using Docker and friends
MIT License
12 stars 3 forks source link

Fix git url parsing #34

Open ganeshmannamal opened 8 years ago

ganeshmannamal commented 8 years ago

It should parse any valid git url

emilsoman commented 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