Applicable to:
- Plesk
Question
Is it possible to connect to private Github repositories by using Plesk Git extension?
Answer
Yes, it is possible by establishing via SSH key generated by Plesk:
-
Go to the Github website.
-
Click the Sign in button:
-
Specify a Github username and a password in the corresponding Username or email address and Password fields:
-
Click an icon of your profile:
-
Press the Settings button:
-
Navigate to the SSH and GPG keys tab:
-
Click the New SSH key button:
-
Go to Domains > example.com > Git.
Note: change the "example.com" domain in the path above to the correct one.
and make sure that the Remote Git hosting like GitHub or BitBucket tab is selected:
-
Specify the private repository name, e.g.:
CONFIG_TEXT: git@github.com:johndoe/test.git
in the Remote Git repository field:
-
Copy the content of the SSH public key field:
back to the Github website, specify the key name in the Title field, insert the copied key from Plesk to the Key field and press the Add SSH key button:
-
Come back to Plesk and press the OK button to clone the private repository.
Comments
5 comments
Hi, the connection is successful, but the auto-deployment seems to be not working from bitbucket...
When I press the PULL UPDATES button - all OK, however, if I Commit to bitbucket, waiting few minutes and the repository is not populated automatically.
What can be the reason of this?
Hello, @Marek Kaczanowicz!
In order to automate this process, web hooks should be used, see the following page for the details:
https://docs.plesk.com/en-US/onyx/administrator-guide/website-management/git-support/using-remote-git-hosting.75848/#o76296
I am using this method mentioned here, but I am unable to connect. I always get the following error:
Public key for the server at 'github.com' is already known in '/var/www/vhosts/new.domain.com/.ssh/git_known_hosts'.
ssh: connect to host github.com port 49153: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Even if I try changing the SSH port to the default 22, I keep getting similar errors.
Any suggestions?
@Evangelos Sapountzis
The cause of this behavior is not clear, but I can see that you have resolved it by deleting id_rsa, id_rsa.pub and known_hosts file from the .ssh folder, according to https://talk.plesk.com/threads/github-integration-errors-unable-to-pull-updates-from-the-remote-repository.354967/
@... Yes, indeed. I managed to resolve it with the help of a Plesk support agent. And the solution is the one found on the link you posted.
Please sign in to leave a comment.