I’m attempting to use a private repo in composer inside a travis build.
On my local install (docker) this works as expected.
Currently in my composer.json
:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/[organisation]/[repo]"
}
]
I’ve attempted to follow the instructions within:
This includes adding:
before_install:
- echo -e "machine github.com\n login $GITHUB_TOKEN" > ~/.netrc
I call the composer install via:
- travis_retry composer self-update
- travis_retry composer install
(those variables are defined)
Failed to download [organisation]/[repo] from dist: The “https://api.github.com/repos/[organisation]/[repo]/zipball/851ecba22de6d5f7e6c37c75dcbc713256bef319” file could not be downloaded (HTTP/1.1 404 Not Found)
I have attempted this various ways.
I’ve also attemped the following (which was suggested in another thread):
before_install:
- echo -e "machine github.com\n login $GITHUB_TOKEN" > ~/.netrc
- git config --global credential.helper store
- |
git credential fill <<! | git credential approve
url=https://github.com/
username=$GITHUB_USERNAME
password=$GITHUB_TOKEN
!
Which gets me:
Package operations: 105 installs, 0 updates, 0 removals
- Downloading [organisation]/[repo] (dev-staging 851ecba)
Failed to download [organisation]/[repo] from dist: The "https://api.github.com/repos/[organisation]/[repo]/zipball/851ecba22de6d5f7e6c37c75dcbc713256bef319" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
- Syncing [organisation]/[repo] (dev-staging 851ecba) into cache
[RuntimeException]
Failed to execute git clone --mirror -- 'git@github.com:[organisation]/[repo].git' '/home/travis/.cache/composer/vcs/git-github.com-[organisation]-[repo].git/'
Cloning into bare repository '/home/travis/.cache/composer/vcs/git-github.com-[organisation]-[repo].git'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
While this looks like a permissions issue I can’t seem to solve it. I’ve tried several variations, including using my own valid token… but I am at my whit’s end on this. Does anyone have any ways to sort or debug this?
Thanks
Rick