我试图通过git push
命令在Herkoku上部署我的PHP项目。在作曲家无法安装存储在Bitbucket私有存储库中的私有软件包之前,情况一切正常。返回的消息是:
remote: Compressing source files... done.
remote: Building source:
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote: - php (7.0.6)
remote: - ext-exif (bundled with php)
remote: - ext-gd (bundled with php)
remote: - ext-mbstring (bundled with php)
remote: - apache (2.4.20)
remote: - nginx (1.8.1)
remote: -----> Installing dependencies...
remote: Composer version 1.1.1 2016-05-17 12:25:44
remote: Loading composer repositories with package information
remote: Installing dependencies from lock file
remote: - Installing doctrine/lexer (dev-master 83893c5)
remote: Downloading: 100%
remote:
remote: - Installing doctrine/annotations (dev-master f25c8aa)
remote: Downloading: 100%
remote:
remote: - Installing doctrine/cache (dev-master e0ef9e9)
remote: Downloading: 100%
remote:
remote: - Installing doctrine/collections (dev-master 866e100)
remote: Downloading: 100%
remote:
remote: - Installing private-repo/private-repo (dev-master cff3e2d)
remote: Cloning cff3e2d83977df680e724b8857f18ebea85af420
remote:
remote: [RuntimeException]
remote: Failed to execute git clone --no-checkout 'git@bitbucket.org:private-repo/private-repo.git' '/tmp/build_83b3c2f9665a4335124a98bf13b0d85b/vendor/private-repo/private-repo' && cd '/tmp/build_83b3c2f9665a4335124a98bf13b0d85b/vendor/private-repo/private-repo' && git remote add composer 'git@bitbucket.org:private-repo/private-repo.git' && git fetch composer
remote: Cloning into '/tmp/build_83b3c2f9665a4335124a98bf13b0d85b/vendor/private-repo/private-repo'...
remote: Host key verification failed.
remote: fatal: Could not read from remote repository.
remote: Please make sure you have the correct access rights
remote: and the repository exists.
remote:
remote: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--op
timize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote:
remote: ! Push rejected, failed to compile PHP app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to xxx.
我已经上传了我的rsa-key,我通常使用Bitbucket对我的Heroku帐户进行身份验证。
有人知道如何让Heroku使用我的Bitbucket存储库进行身份验证吗?
答案 0 :(得分:0)
终于搞定了。现在使用http基本身份验证将Heroku与Bitbucket连接起来。遵循以下步骤:
转换存储库url my package.json(包含我的私有包)
来自:git@bitbucket.org:private-repo/private-repo.git
到:
https://username@bitbucket.org/private-repo/private-repo.git
然后将以下配置添加到我的composer.json:
"config": {
"bitbucket-oauth": {
"bitbucket.org": {
"consumer-key": "Bitbucket username",
"consumer-secret": "Bitbucket password"
}
}
}
不建议将密码存储在纯文本文件中,但遗憾的是Bitbucket没有给我们选择