WP Renovate Bot

Bot to update WordPress repositories on Bitbucket Cloud, inspired by renovate bot. By providing a list of BitBucket repositories the wp renovate bot will go through every repository and update any available updates.

Run image

docker run -it labelvier/wp-renovate

Shared (current) folder:

docker run -it --mount type=bind,source="$(pwd)/wp-renovate",target=/wp-renovate --workdir="/wp-renovate" labelvier/wp-renovate

Configuration Options

Every run needs a wp-renovate.json for variables / options to be set. Some variables can also be set using a .env file or set as globals

Example wp-renovate.json

{
  "username": "renovate-bot-labelvier",
  "password": "super-secret",
  "platform": "bitbucket",
  "repositories": [
    "labelvier/labelvier.git",
    "renovate-bot-labelvier/wp-starter-kit-test.git"
  ],
  "baseBranch": "develop",
  "dryRun" : false,
  "wordpress": {
    "extraConfig": {
      "GF_LICENSE_KEY": "123456789",
      "FACETWP_LICENSE_KEY": "123456789",
      "ACF_PRO_LICENSE" : "123456789"
    },
    "evalFiles": [
      "php/activate-acf.php"
    ]
  }
}

Parameters

username

NameValue
typestring
requiredyes
loadedwp-renovate.json
.env
global

Username to log in to Bitbucket.

password

NameValue
typestring
requiredyes
loadedwp-renovate.json
.env
global

Password to log in to Bitbucket.

platform

NameValue
typestring
requiredyes
loadedwp-renovate.json
possible valuesbitbucketcustom

Platform where the repository is cloned from. When using custom, wp-renovate will do a clone directly on the repository url without appending any user / password / url’s.

repositories

NameValue
typearray
requiredyes
loadedwp-renovate.json

List of repositories that wp-renovate needs to update.

baseBranch

NameValue
typestring
requiredyes
loadedwp-renovate.json
.env
global

Branch that wp-renovate pulls from and pushes it’s updates to.

dryRun

NameValue
typeboolean
requiredno
defaultfalse
loadedwp-renovate.json
.env
global

If enabled, wp-renovate will not push to the repositories, but echo it’s open commits.

wordPress

NameValue
typeobject
requiredno
loadedwp-renovate.json

The wordpress object allows you to manipulate the wp cli to add extra configs or run php files before running the updates.

extraConfig
NameValue
typekey-value object
requiredno
loadedwp-renovate.json

Allows you to add extra lines to the wp-config file. Useful when updating commercial licenses like GravityForms:

evalFiles
NameValue
typearray
requiredno
loadedwp-renovate.json

Allows you to run php files before starting updating. Useful when updating commercial licenses or manipulating the WordPress installation.

plugins
NameValue
typearray
requiredno
loadedwp-renovate.json

Allows you to pin certain plugins to a specific version. This runs a force update on that version.

reinstallCrashedPlugins
NameValue
typeboolean
requiredno
loadedwp-renovate.json

Warning, experimental! This tries to reinstall a plugin which triggers a php 500 error on activation

Build docker

If you want to build the image yourself, run the following command. docker build -t labelvier/wp-renovate .

Tests

Testing is done using bats. To do a tes run, run the following command in the test folder: bats -t test.bats