Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

add an config param to override the git protocol #82

Merged
merged 3 commits into from
Apr 14, 2016

Conversation

jgoulah
Copy link
Contributor

@jgoulah jgoulah commented Apr 12, 2016

the read_write param isn't passed consistently to git_url, and there are some places where it may even be hard to pass (such as get '/head_rev/:stack')

this patch is backward compatible with the current functionality but gives the user the ability to add a stack config option such as :git_protocol => "git@", which will overwrite the default of git://

This allows deployinator to work with private repositories without changing all the invocations of git_url, get_git_head_rev and git_head_rev and wherever else it may be called from

@juliettepaul
Copy link
Contributor

Looks good to me once tests are fixed. It's just checking how many times a method is called in there which is kind of a meh test but we should fix it

@jgoulah
Copy link
Contributor Author

jgoulah commented Apr 12, 2016

@jayson done

assert_equal('https://www.testmagic.com/construction/drills.git', GitHelpers.git_url(:stack, 'https', false))
end

def test_git_url_default
GitHelpers.expects(:which_github_host).returns("www.testmagic.com")
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
GitHelpers.expects(:git_info_for_stack).returns({:stack => {:repository => 'drills', :user => 'construction'}})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you delete the extra lines and add .at_least_once to the end it should fix this

@juliettepaul
Copy link
Contributor

@jgoulah made one more suggestion to get rid of silly extra lines. I tested command works if you can add that I will merge asap. Thanks again

@jgoulah
Copy link
Contributor Author

jgoulah commented Apr 12, 2016

@jayson done

@juliettepaul juliettepaul merged commit eeb2b75 into etsy:master Apr 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants