无法将git存储库部署到dokku实例(致命:{reponame}似乎不是git存储库)

Ron*_*nin 6 git ssh digital-ocean dokku

我正在尝试将我的本地git repo上的应用程序部署到digitalocean上的dokku实例.

区域文件

$ORIGIN mydomain.com.
$TTL 1800
...
mydomain.com. 1800 IN A 11.22.33.44
www.mydomain.com. 1800 IN CNAME mydomain.com.
*.mydomain.com. 1800 IN A 11.22.33.44
test.mydomain.com. 1800 IN A 11.22.33.44
Run Code Online (Sandbox Code Playgroud)

我打算部署我的应用程序 test.mydomain.com

dokku设置

我使用digitalocean上的dokku映像来设置服务器,该服务器目前在dokku上运行v0.4.15,并尝试根据显然过时的指南部署我的应用程序,但是,我没有找到更新的.

ssh设置

我还设置了SSH密钥和配置文件,因此我可以通过SSH登录我的dokku实例,用户rootdokku:

ssh {username}@test.localhome.ch // works

本地ssh配置文件

Host          mydomain.com test.mydomain.com
        HostName       11.22.33.44
        IdentityFile   ~/.ssh/mydomain
        PreferredAuthentications publickey
Run Code Online (Sandbox Code Playgroud)

部署

当我尝试部署我的git repo时:

git remote add dokku dokku@test.mydomain.com:test
git push dokku master
Run Code Online (Sandbox Code Playgroud)

它会扔给我

fatal: 'test' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

编辑1

我也ssh'ed到服务器并添加了dokku应用程序

ssh dokku@mydomain.com
dokku apps:create test
Run Code Online (Sandbox Code Playgroud)

该应用程序似乎已在服务器端正确添加..

dokku@mydomain:~$ dokku apps
=====> My Apps
test
Run Code Online (Sandbox Code Playgroud)

..然而,推动仍然失败.

Ron*_*nin 9

我无法为digitalocean上的oneclick dokku-installation解决问题,所以相反,我不得不手动设置实例,这并不难.

Dokku设置

  1. 创建一个新的Ubuntu 14.04.4 x64Droplet.
  2. 不要设置RSA,使用密码验证登录Droplet.
  3. 安装dokku:

    wget https://raw.githubusercontent.com/dokku/dokku/v0.5.2/bootstrap.sh sudo DOKKU_TAG = v0.5.2 bash bootstrap.sh

设置RSA

假设:我们不使用默认RSA密钥(通常.ssh/id_rsa.pub),而是使用自定义RSA密钥:.ssh/custom.pub

  1. 使用以下单行添加公钥

    cat~/.ssh/custom.pub | ssh root@mydomain.com"sudo sshcommand acl-add dokku custom-identifier"

有关更多信息,请参阅此页面

部署回购

部署您的仓库,为了快速测试,可以使用此示例.此外,需要相应地设置DNS(如果应用程序名称是test,test.mydomain.com则应指向您的服务器IP,如OP中所示).