Atlassing can't tell me this (tried support but they can't tell me, because of lack of experience), but they pointed me to this form, which I've search for an hour.
BTW: I'm not looking for a Satis solution, because it is another process running on everybodies computer. I'm looking for a direct solution.
We have private repositories that are in use in other private repositories.
So we want composer (php package manager) to get a repository (even when it is private)
But somehow I get errors like:
Your requirements could not be resolved to an installable set of packages.Problem 1
- The requested package our_vendor/our_private_package could not be found in any version, there may be a typo in the package name.Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
To show that I have/did/tried:
I have a dev-branch on a private repository
"repositories":[
{
"type": "git",
"url": "git@bitbucket.org:our_vendor/our_private_package.git"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"our_vendor/our_private_package": "*@dev"
},
I tried:
"config": {
"bitbucket-oauth": {
"bitbucket.org": {
"consumer-key": "my_key",
"consumer-secret": "my_secret"
}
}
},
I tried to change the requirements
"require": {
"our_vendor/our_private_package": "dev-dev as 1.0.0"
},
or into
"require": {
"our_vendor/our_private_package": "dev-dev"
},
or into
"require": {
"our_vendor/our_private_package": "*"
},
I tried to add the branch to the repository:
"repositories":[
{
"type": "vcs",
"url": "git@bitbucket.org:allunited/smart.git",
"branch": "dev"
}
],
So I tried a lot of things, but without success.
The only thing that works, is to have the repositories point out to a local (git cloned) version of the private repository (the same way Satis does it), but this should not be the end solution.
I was able to fix this issue by pushing a version tag to my package repository
I pushed v0.0.1 because it was a very early stage for me. After running composer update, everything worked out.
You can use composer update -vv to get more insights.
Edit: After pushing v0.0.2, composer actually did update my package AND it showed me the commit-id and commit message.
Note that the repository you are requiring should also have its own composer.json, the name set for the package there must match the name of the package you are including (vendor/projectname in my example above).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've also tried many settings in composer.json, and it took some time to figure out the correct way to do it.
Side note: I'm using a private Gitlab repo here, not sure if it applies to bitbucket as well.
This is what works (at least) for me:
{
"repositories": [
{
"type": "git",
"url": "git@my-gitlab-server:ivo/my-package.git"
}
],
"require": {
"ivo/my-package": "*"
},
"minimum-stability": "dev"
}
Good luck and let me know if it worked for you please!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this! They key for me was using dev-master because the package is brand new and not yet versioned. Is just a single master line.
"org/package": "dev-master"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad you found a solution!
Thanks for the update!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't suppose you'd be able to share a full configuration? I am having trouble getting this working and I feel as though I have tried all combinations of config!
Some things to note:
- Using composers auth.json
- Targeting the master branch using "dev-master"
- Using the https URL as suggested by composers documentation
The error I am currently receiving is "fatal: repository 'git@bitbucket.org/{VENDOR}/{REPO}.git' does not exist" but I have receive various error depending on the composer.json I use.
Any help would be awesome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, the new pieces to make it work are just in the parent projects composer.json
"bitbucket-oauth": {
"bitbucket.org": {
"consumer-key": "key-name-goes-here",
"consumer-secret": "ssh-rsa..."
}
},
"repositories" : [
{
"type": "vcs",
"url": "git@bitbucket.org:DOMAIN/REPO.git"
}
],
"require": {
...
"DOMAIN/REPO": "dev-master"
}
Also in the child library projects composer.json I added this because we don't have real usage of branches/tags (yet), so pulling from master is fine
"extra": {
"branch-alias": {
"dev-master": "master"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.