-
Notifications
You must be signed in to change notification settings - Fork 7
Auto update your website
Running wp build-generate will list all active plugins and active theme with their current version in the build.yml file that looks like this:
core:
download:
version: 4.9.4
locale: en_US
plugins:
advanced-custom-fields:
version: 4.4.12
timber-library:
version: 1.7.0
wordpress-popular-posts:
version: 4.0.13
wordpress-seo:
version: 6.3.1
themes:
twentyseventeen:
version: 1.4Here you can specify which plugin or theme to auto update or which one that has breaking changes potential, should remain on a fixed version.
You have these choices:
-
'*'Latest version -
'4.9.*'Latest minor version -
1.7.0Fixed version
Following is a copy of one of our production websites:
core:
download:
version: 4.9.4
locale: nb_NO
plugins:
adblock-notify-by-bweb:
version: '*'
advanced-custom-fields:
version: '*'
amp:
version: '*'
co-authors-plus:
version: '*'
disable-comments:
version: '*'
elasticpress:
version: 2.3.2
shortcode-ui:
version: '*'
timber-library:
version: 1.7.0
tinymce-advanced:
version: '*'
wordpress-popular-posts:
version: '*'
wp-super-cache:
version: '*'
wordpress-seo:
version: '*'This example don't contain any theme, because we use custom build theme.
On the server create a shell script that runs wp build command. Our instance looks like:
cd /path/to/website/root/directory(public_html)
/usr/local/bin/wp buildDon’t forget to give the shell script correct permission. In this case, 755.
Then create cron job by running crontab -e
And create cron job as your need and how aften you want to run it:
0 1 * * * /path/to/shell/script/update.sh 1&>/dev/nullThis example, will run every night at one o'clock.