Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private Repo on Bitbucket without installed GIT don't work #3893

Closed
mad99 opened this issue Mar 31, 2015 · 6 comments
Closed

private Repo on Bitbucket without installed GIT don't work #3893

mad99 opened this issue Mar 31, 2015 · 6 comments
Labels

Comments

@mad99
Copy link

mad99 commented Mar 31, 2015

Hi together,
Composer is a really cool tool. Thank you very much for this!

There's a point, that left me stuck. Contao's Plugin System is use of Composer. There an error was thrown because I used the included credentials »username:password@« without installed or wrong installed GIT on publish Server. The Error could be from Composer itself.

There is a private Repository on Bitbucket. I would like to use it with the username:password@ included url in composer.json like :
"repositories": [
{
"type": "vcs",
"url": "https://username:password@bitbucket.org/ownername/reponame.git"
},
{
"type": "artifact",
"url": "packages"
}
]
On the publish Server, there is no GIT installed nor SSH-KEY file create-able. So the error printout from Composer is:
Failed to clone https://username:***@bitbucket.org/ownername/reponame.git, git was not found, check that it is installed and in your PATH env. git: not found

In Contao-Community (https://community.contao.org/de/showthread.php?56354-funktioniert-Composer-mit-privatem-Bitbucket-Repository-ohne-SSH-Key-auf-Server) a nice guy told me, it could appear because the regular expression in

if (!preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#', $url)) {
.

Maybe you could change the Regex, so the username:password@ possibility would work also without installed GIT. Or maybe you could deliver an different Error-Message: Like "Composer can't use your included credentials password:username@ in the url. Please use the auth.json instead of it."

Thanks to michael.g I found a workaround with the auth.json, so I can use the private Bitbucket Repo without installed or wrong installed GIT OR SSH-KEY on the public server. But without Michael I would stuck for a long time ...

Kind regards and thank you very much for your work on composer
Martin

@GromNaN
Copy link
Contributor

GromNaN commented Apr 1, 2015

The auth.json is the preferred method to handle authentication. You should never commit your credentials. Composer should have asked your credentials interactively.

See also: http://seld.be/notes/authentication-management-in-composer

@frederikbosch
Copy link
Contributor

@mad99 Use auth.json as @GromNaN is saying. But I guess your setup will not work anyway. git was not found, check that it is installed and in your PATH env. git: not found. You cannot use the GitBitbucketDriver on a server that has no git. You should consider changing your deployment strategy.

@kfreiman
Copy link

kfreiman commented Apr 9, 2015

May be, --prefer-dist flag will be helpfull

@frederikbosch
Copy link
Contributor

@kfreiman --prefer-dist is not useful: he is using a vcs (git repo) and not a composer repository.

@mad99
Copy link
Author

mad99 commented Apr 10, 2015

Thank you for your help.
Strangely, on the server - according to the support - the Git-binary is under /usr/local/bin installed. An <?php var_dump(exec('echo $ PATH')?); produces the output:
string(60) "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin".
So everything should be correct.
Nevertheless, the auth.json is a good way.

@frederikbosch : > You should consider changing your deployment strategy.
That could be a very good idea :o)). Can you recommend a good »deployment strategy overview« link for composer or in general? I would love to optimize.

@frederikbosch
Copy link
Contributor

@mad99 My advice was meant for the case you do not have git on your server. If this issue is not relevant anymore, please close it.

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

No branches or pull requests

5 participants