Learn how to clone Bitbucket into cPanel. Our cPanel Support team is here to help you with your questions and concerns.
How to clone Bitbucket into cPanel
Did you know that efficient code deployment plays a key role in maintaining a seamless development workflow in web development?
If you’re using cPanel Git™ Version Control and looking to set up a pull deployment, this step-by-step guide is here to assist you.
We will cover the basics, including cloning remote repositories, creating deployment configurations, and addressing common issues.
Cloning Remote Repository to cPanel Account
- Clone Using cPanel’s Git Version Control Interface
If our desired repository does not exist on our cPanel account, we have to use cPanel’s Git Version Control interface to clone it. We can find this option at
cPanel > Home > Files > Git Version Control.
Our experts would like to point out that this feature enforces restrictions on clone URLs and verifies the remote host’s public SSH keys for ssh:// clone URLs.
- Clone to Local Computer
If we have not cloned the remote repository to our local computer, we can get this done by running:
git clone URL
Creating .cpanel.yml File
To deploy changes from a cPanel-managed repository, we have to check a .cpanel.yml file into the repository’s top-level directory. This file defines deployment tasks. We can create and commit this file either locally or on the remote repository.
Here is a sample .cpanel.yml file:
deployment:
tasks:
- export DEPLOYPATH=/home/user/public_html/
- /bin/cp index.html $DEPLOYPATH
- /bin/cp style.css $DEPLOYPATH
Then, we can push changes to the remote repository with this command:
git push origin HEAD
How to Pull and Deploy Changes from cPanel Interface
- To begin with, head to cPanel’s Git Version Control interface. We can find this at:
cPanel > Home > Files > Git Version Control.
- Locate the desired repository and click Manage.
- Then go to the Pull or Deploy tab.
- Now, click Update from Remote to pull changes.
- Finally, click Deploy HEAD Commit to deploy changes.
We have to repeat these steps whenever we want to pull and deploy changes. The system doesn’t automatically deploy changes for this deployment type.
Common Issues and Solutions
- Cloning from Bitbucket to cPanel Git™ Version Control
- First, go to Bitbucket repository settings.
- Then, click Access keys under General.
- Next, add a new key and paste the contents of id_rsa.pub from cPanel’s file manager.
- Repeat the cPanel Git™ Version Control steps.
- SSH Key Setup
- First, generate an SSH key in cPanel’s terminal using `ssh-keygen -t rsa -C YourEmailAddress`.
- Then, add the key to Bitbucket’s SSH Access.
- Incorrect Clone URL
In this case, we have to make sure the Clone URL in cPanel Git™ Version Control is in the format `git@bitbucket.org:username/repo.git`.
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
In brief, our Support Experts demonstrated how to clone Bitbucket into cPanel.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments