WordPress | Deployment of code to live website from Github, Bitbucket or Gitlab

| By Webner

Suppose we have live websites and we are using bitbucket to save the code of plugins, themes etc of those websites. Then we can manage the deployment to live sites easily through the WP pusher plugin.

WP Pusher plugin is used for the deployment of code to the live websites very easily from Github, Bitbucket or Gitlab with GUI i.e we need not type the commands to get it done. We can deploy plugins and themes. We can install new plugins, themes etc as well as link the repository with the already installed plugins, themes so that any change in their code on bitbucket repository can change the live website automatically.

For this purpose, we need a repository in the bitbucket in which our plugin or theme code will be stored. Let us assume repository named as “‘exampleRepo’”.
Now as we can have many branches in a repository so let our branch be “examplebranch”.

Step 1. Install and activate WP Pusher plugin

Step 2. WP Pusher plugin menu will be visible on the left side. Click on that.

Step 3. Enter the license key that you will get while purchasing the plugin. Each license will work with mostly 5 sites. But we can make it to work on more by contacting their support.

Step 4. Click on Bitbucket tab. You will be asked for Bitbucket token. Generate that by clicking on “Obtain a Bitbucket token”. Then save it.

Step 5. Now suppose we want to link a particular branch of a repository to a particular plugin so that any change in the code on bitbucket will update the website. For that purpose, Click on “Install Plugin” from left side menu

Step 6. Enter the details of the repository and branch etc in it

Repository host – Check the Bitbucket
Plugin Repository – Enter the repository in which your plugin code is. For example if our plugin code is in repository ‘exampleplugin’ and it is in the team ‘exampleteam’ so our plugin repository will be ‘exampleteam/exampleplugin’
Repository Branch – Enter the particular branch name (if we have more than 1 branches in repository) from which the code is to deployed otherwise it will take master branch by default.
Repository Subdirectory – If we have subdirectories inside the repository then enter the name of it in this otherwise leave it blank.
Repository is private – If our repository is private then tick on it else not.
Push-to-Deploy – If we want to update the code automatically to the sites whenever we will push the code to bitbucket then tick this option. Otherwise we will have to push the code and click on update plugin each time we make any changes.
Link Installed Plugin – If the plugin we are linking is already in the wordpress then we will tick this option so that it will point to the same plugin and will update that otherwise it will consider it a new plugin and will create issue on updation that the plugin with same name already exists. If we are installing a new plugin (that is not in our website) then we will uncheck this option.


Step 7. Now click “Install plugin”.

Now whenever we will make any changes to this plugin code and will push the changes to bitbucket then the live website will automatically get updated.

We can also update or add the themes through it. Just click on “Install theme” from left side WP Pusher menu and follow similar steps.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *