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

Management of Bitbucket repositories #46

Closed
inigomedina opened this issue Mar 12, 2015 · 6 comments
Closed

Management of Bitbucket repositories #46

inigomedina opened this issue Mar 12, 2015 · 6 comments

Comments

@inigomedina
Copy link

I've been continued developing some small features I really need for using Deployinator as our main deployment-tool. The first one has been regarding to Bitbucket, our hosting for git projects.

Deployinator's helpers for git actions use GitHub as the default service. That means some variables and methods, and mainly some assumptions regarding to the url composition.

I've introduced my "case" within the git_url method, evaluating the github_host and composing specific url when this is set to bitbucket. Of course, there are ways for doing that cleaner and easier to add more services in the future. Do you think it would be interesting a pull-request for starting that?

@cyberrodent
Copy link
Contributor

Using Deployinator.git_info_for_stack you can specify a host:

Deployinator.git_info_for_stack = {
        :test_stack => {
            :host => "bitbucket.org",
            :user => "cyberrodent",
            :repository => "myg",
            :checkout_path => "/tmp/deployinator_dev"
        }

I guess its not too well documented (not in the readme) It can be seen in the code.

@inigomedina
Copy link
Author

The problem is that Bitbucket composes its URLs in a manner that current helper method git_url does not cover. git_url composes two types of URLs, depending on the read/write parameter.

That config value is useful, and in fact I am already using it for my patched method: evaluating the host, and then composing the URL the way each host waits for.

@inigomedina
Copy link
Author

Ok, I see what's happening. The problem is that I am deploying private respositories, and for them, with the current method, I have to pass the param read_write as true, for getting the right URL, that both hosts compose the same way.

But for non read/write repositories, Bitbucket does not allow the URL that git_url method composes this way: git://bitbucket.org/user/repo.git.

@cyberrodent
Copy link
Contributor

I've only used this for r/w. Sounds like there might be a pull request in here.

@juliettepaul
Copy link
Contributor

@inigomedina I have a pull request here that I think will resolve your issue: #49

I added a protocol pass through to the git_freshen_or_clone method so anything you put there will be passed through (http or https for example in your case). Can you please let me know if this works for you and I'll merge it into master?

juliettepaul added a commit that referenced this issue Mar 20, 2015
Fix for issue #46 - allow git protocol passthrough on git
@juliettepaul
Copy link
Contributor

This has been merged, please let me know if this resolves your issue, the last optional parameter to git_freshen_or_clone is the protocol you would like to use.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants