markomarkovic/simple-php-git-deploy

SSH vs. HTTPS

DavidGagne opened this issue · 2 comments

Should the application type of the webhook be set to json or urlencoded? (Does it matter?)

I'm receiving the following:

Checking the environment ...

Running as {my username}.

/usr/bin/git : git version 1.7.9.5
/usr/bin/rsync : rsync version 3.0.9 protocol version 30

Environment OK.

Deploying https://github.com/{my username}/{my repo name}.git master
to /{my domain name}/ ...

$ git clone --depth=1 --branch master https://github.com/{my username}/{my repo name}.git /tmp/spgd-4bec90563b66bae9a40edcb0b612c31b/
Cloning into '/tmp/spgd-4bec90563b66bae9a40edcb0b612c31b'...
fatal: could not read Username for 'https://github.com': No such device or address

Error encountered!
Stopping the script to prevent possible data loss.
CHECK THE DATA IN YOUR TARGET DIR!

I was able to resolve this by updating the REMOTE_REPOSITORY variable in deploy-config.php to include my GitHub username and password, but I fear that this is not optimal.
Now it's not actually working over SSH, I think, but just using https://.

Yes, I added the content's of my Dreamhost user's ssh id_rsa.pub file to my repo's keys, but it's not working, even though I can connect via ssh directly from my Dreamhost server.

Ah HA!

I solved the problem.

If you're connecting via SSH you need to change the REMOTE_REPOSITORY variable to:

git@github.com:USERNAME/REPONAME.git

instead of:

https://github.com/USERNAME/REPONAME.git