Skip to content

Instantly share code, notes, and snippets.

@kjbrum
Last active March 10, 2018 18:31
Show Gist options
  • Save kjbrum/04a243995c3334edbd23 to your computer and use it in GitHub Desktop.
Save kjbrum/04a243995c3334edbd23 to your computer and use it in GitHub Desktop.
Easily set up a project with a Bitbucket repository, ServerPilot application, base plugin and theme, as well as run miscellaneous WordPress tasks.

WordPress Setup Script

Easily set up a project with a Bitbucket repository, ServerPilot application, base plugin and theme, as well as run miscellaneous WordPress tasks. Should be used with https://github.com/Mixd/wp-deploy.

Step 1: Setup project

# Enter your project directory
cd your/desired/project/directory

# Clone the WP-Deploy repo
git clone --recursive https://github.com/Mixd/wp-deploy.git

Step 2: Download the prepare script and config file

This will download the prepare.sh and config.cfg files. Feel free to check them out in the browser before you download them.

# Run this command while at the root of your project
curl -L -o 'config/prepare.sh' http://bit.ly/1eTBs6S && curl -L -o 'config/config.cfg' http://bit.ly/1MbuNnp

Step 3: Update the config file

You will need to add the following to the config.cfg file or just comment the lines out of the prepare.sh file:

  • ServerPilot Client ID
  • ServerPilot API Key
  • ServerPilot Server User ID
  • BitBucket Username
  • BitBucket Password
  • Base Plugin Repo Name
  • Base Theme Repo Name

Step 4: Add deployment keys

If you want BitBucket to add your deployment keys to the new BitBucket repo, you can add a file called deployment.txt at the root of the project. Be sure to have one deployment key per line.

Note: You need to leave an empty line at the bottom of the file. Not sure what the issue is.

Step 5: Run the script

Once you have all that done, you should be able to run the prepare script with:

. config/prepare.sh

Step 6: Profit

💰 💵 💸

 

Feel free to read a more thorough writeup over on my blog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment