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
Name | Value |
---|---|
type | string |
required | yes |
loaded | wp-renovate.json .env global |
Username to log in to Bitbucket.
password
Name | Value |
---|---|
type | string |
required | yes |
loaded | wp-renovate.json .env global |
Password to log in to Bitbucket.
platform
Name | Value |
---|---|
type | string |
required | yes |
loaded | wp-renovate.json |
possible values | bitbucket, custom |
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
Name | Value |
---|---|
type | array |
required | yes |
loaded | wp-renovate.json |
List of repositories that wp-renovate needs to update.
baseBranch
Name | Value |
---|---|
type | string |
required | yes |
loaded | wp-renovate.json .env global |
Branch that wp-renovate pulls from and pushes it’s updates to.
dryRun
Name | Value |
---|---|
type | boolean |
required | no |
default | false |
loaded | wp-renovate.json .env global |
If enabled, wp-renovate will not push to the repositories, but echo it’s open commits.
wordPress
Name | Value |
---|---|
type | object |
required | no |
loaded | wp-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
Name | Value |
---|---|
type | key-value object |
required | no |
loaded | wp-renovate.json |
Allows you to add extra lines to the wp-config file. Useful when updating commercial licenses like GravityForms:
evalFiles
Name | Value |
---|---|
type | array |
required | no |
loaded | wp-renovate.json |
Allows you to run php files before starting updating. Useful when updating commercial licenses or manipulating the WordPress installation.
plugins
Name | Value |
---|---|
type | array |
required | no |
loaded | wp-renovate.json |
Allows you to pin certain plugins to a specific version. This runs a force update on that version.
reinstallCrashedPlugins
Name | Value |
---|---|
type | boolean |
required | no |
loaded | wp-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