Setting up Deployment for a Plugin or Theme

Step 1. Create Bitbucket Repository

In your git client, create new remote repo. Place the plugin files in this directory. Commit and push these files, with a message like “Initial commit at version x.y.z”

Step 2. Set Up Buddy Project

Login to Buddy and open the “beyondthebrandmedia” workspace, click the “Create a new project” button. This loads in the repositories we have on Bitbucket, go ahead and search or scroll to find our newly created repo. Connected!

Step 3. Add a New Pipeline

Click add a new Pipeline. If there’s a plugin project we’ve already set up on Buddy that is used on a similar array of sites, you can choose “duplicate”, select it, and copy it’s pipeline to reduce the amount of site information you’ll need to enter. You’ll still need to go into each action to change the remote path. But if you’re doing it from scratch, enter the name “Deploy to Production”, set the trigger to “Manual”, and branch to “Master”.

Step 4. Add an Action

Add an “Rsync” action. We’re going to have one of these for each site that we plan to deploy the plugin to. The process for each one is as follows: Leave the filesystem path blank. For the host, port, and login, check and see if there’s a workspace variable already in Buddy. Type “$” and a dropdown should appear with a list of variables. See if there’s a set matching the site you’re trying to deploy to, and if so, use those. Otherwise, copy over the information from the Kinsta info tab. For “Authentication mode” select “Buddy’s Workspace Key”. For the remote path, browse, and navigate through “public/wp-content/plugins/pluginname”. For the Rsync options, check compression, archive, delete, and recurse. Leave transfer directories and custom options unchecked. In the action tab, you can rename to something like “Rsync to Sitename”. Make sure you save the action!

Step 5. Deploy and Repeat

Before deploying for the first time, make sure there’s a backup on the Kinsta server. Now you can press run to deploy to make sure that it’s working as intended, and repeat step 4 for each site that you wish to deploy this plugin to.