Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't deploy git repository to dokku instance (fatal: {reponame} does not appear to be a git repository)

I'm trying to deploy my application which is located on my local git repo to my dokku instance on digitalocean.

Zone file

$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

I intend to deploy my app on test.mydomain.com

dokku setup

I used the dokku image on digitalocean to setup the server, which currently runns on dokku v0.4.15, and tried to deploy my app according to the guide which is obviousely obsolete, however, I didn't find a more recent one.

ssh setup

I also set up the SSH keys and config file, so I'm able to log in to my dokku instance over SSH for both users root and dokku:

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

local ssh config file

Host          mydomain.com test.mydomain.com
        HostName       11.22.33.44
        IdentityFile   ~/.ssh/mydomain
        PreferredAuthentications publickey

deployment

When I try to deploy my git repo:

git remote add dokku [email protected]:test
git push dokku master

it would throw me

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.

What did I miss?

Edit 1

I also ssh'ed into the server and added the dokku app

ssh [email protected]
dokku apps:create test

The app seems to have been added correctly server-side..

dokku@mydomain:~$ dokku apps
=====> My Apps
test

.. however, the push is still failing.

like image 383
Ronin Avatar asked Mar 27 '16 00:03

Ronin


1 Answers

I wasn't able to solve the problem for the oneclick dokku-installation on digitalocean, so instead, I had to setup the instance manually, which wasn't that hard.

Dokku setup

  1. Create a new Ubuntu 14.04.4 x64 droplet.
  2. Don't setup the RSA yet, use password authentication to login to the droplet.
  3. Install dokku:

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

Setup RSA

Assumption: We don't use the default RSA key (usually .ssh/id_rsa.pub), but instead a custom one: .ssh/custom.pub

  1. add the public key using the following one-liner

    cat ~/.ssh/custom.pub | ssh [email protected] "sudo sshcommand acl-add dokku custom-identifier"

For more information please refer to this page

Deploy repo

Deploy your repo, for a quick test this example can be used. Also, the DNS need to be setup accordingly (if the apps name is test, then test.mydomain.com should point to your servers IP, as also shown in the OP).

like image 121
Ronin Avatar answered Sep 21 '22 00:09

Ronin