Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 870e561

Browse files
committed
RedHat: Adding support for WordPress 6.
1 parent 0083fa6 commit 870e561

8 files changed

Lines changed: 183 additions & 8 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Catapult orchestrates the following key components of DevOps to provide you with
160160

161161
Catapult intelligently manages the following website software that have been chosen from trending usage statistics from [BuiltWith](https://trends.builtwith.com/cms) and aligns with the [CentOS 7](http://mirror.centos.org/centos/7/os/x86_64/Packages/) and [Software Collections](https://www.softwarecollections.org/) trunks:
162162

163-
Software | [Key](#websites) | Required PHP Version | Running PHP Version | Released | End-of-Life
163+
Software | [Key](#websites) | Minimum PHP Version | Running PHP Version | Released | End-of-Life
164164
---------|------------------|---------------------|---------------------|----------|------------
165165
CodeIgniter 2 | `codeigniter2` | 5.1.6 | 5.4 | January 28, 2011 | [October 31, 2015](http://forum.codeigniter.com/thread-61357.html)
166166
CodeIgniter 3 | `codeigniter3` | 5.6 | 7.1 | March 30, 2015 |
@@ -177,8 +177,9 @@ MediaWiki 1 | `mediawiki1` | 5.5.9 | 7.1 | Dece
177177
Moodle 3 | `moodle3` | 5.6.5 | 7.1 | November 16, 2015 |
178178
SilverStripe 3 | `silverstripe3` | 5.3.3 | 5.4 | June 29, 2012 |
179179
SuiteCRM 7 | `suitecrm7` | 5.5 | 7.1 | October 21, 2013 | [November 15, 2019](http://support.sugarcrm.com/Resources/Supported_Versions/)
180-
WordPress 4 | `wordpress4` | 5.2.4 | 7.1 | September 4, 2014 |
181-
WordPress 5 | `wordpress5` | 5.2.4 | 7.2 | December 6, 2018 |
180+
WordPress 4 | `wordpress4` | 5.2 | 7.1 | September 4, 2014 |
181+
WordPress 5 | `wordpress5` | 5.6 | 7.2 | December 6, 2018 |
182+
WordPress 6 | `wordpress6` | 5.6 | 7.2 | May 24, 2022 |
182183
XenForo 1 | `xenforo1` | 5.2.11 | 5.4 | March 8, 2011 | [December 31, 2019](https://xenforo.com/community/threads/xenforo-1-5-end-of-life-schedule.157679/)
183184
XenForo 2 | `xenforo2` | 5.4.0 | 7.1 | November 28, 2017 |
184185
Zend Framework 2 | `zendframework2` | 5.3.23 | 5.4 | September 5, 2012 |
@@ -924,6 +925,7 @@ The following options are available:
924925
* option: `software: suitecrm7`
925926
* option: `software: wordpress4`
926927
* option: `software: wordpress5`
928+
* option: `software: wordpress6`
927929
* option: `software: xenforo1`
928930
* option: `software: xenforo2`
929931
* option: `software: zendframework2`
@@ -1002,6 +1004,7 @@ Software | Install Approach | Install Notes
10021004
`suitecrm7` | Fork |
10031005
`wordpress4` | Fork |
10041006
`wordpress5` | Fork |
1007+
`wordpress6` | Fork |
10051008
`xenforo1` | Download |
10061009
`xenforo2` | Download |
10071010
`zendframework2` | Fork | Your best bet is to start from the [zendframework/ZendSkeletonApplication](https://github.com/zendframework/ZendSkeletonApplication) GitHub project. Catapult assumes Zend Framwork is at the root of your repo and writes a database config file at `config/autoload/global.php`, you will also need to set `webroot: public/` in your Catapult configuration.
@@ -1029,6 +1032,7 @@ Software | `software_auto_update` Support
10291032
`suitecrm7` | [:x:](https://suitecrm.com/wiki/index.php/Upgrade)
10301033
`wordpress4` | :white_check_mark:
10311034
`wordpress5` | :white_check_mark:
1035+
`wordpress6` | :white_check_mark:
10321036
`xenforo1` | [:x:](https://xenforo.com/help/upgrades/)
10331037
`xenforo2` | :white_check_mark:
10341038
`zendframework2` | :white_check_mark:
@@ -1126,6 +1130,7 @@ Software | Approach | Documentation
11261130
`suitecrm7` | |
11271131
`wordpress4` | Database | http://codex.wordpress.org/Changing_The_Site_URL
11281132
`wordpress5` | Database | http://codex.wordpress.org/Changing_The_Site_URL
1133+
`wordpress6` | Database | http://codex.wordpress.org/Changing_The_Site_URL
11291134
`xenforo1` | |
11301135
`xenforo2` | |
11311136
`zendframework2` | |
@@ -1231,6 +1236,7 @@ Software | Tool | Command | Documentation
12311236
`suitecrm7` | | |
12321237
`wordpress4` | WP-CLI | `wp-cli core update-db` | http://codex.wordpress.org/Creating_Tables_with_Plugins#Adding_an_Upgrade_Function
12331238
`wordpress5` | WP-CLI | `wp-cli core update-db` | http://codex.wordpress.org/Creating_Tables_with_Plugins#Adding_an_Upgrade_Function
1239+
`wordpress6` | WP-CLI | `wp-cli core update-db` | http://codex.wordpress.org/Creating_Tables_with_Plugins#Adding_an_Upgrade_Function
12341240
`xenforo1` | | |
12351241
`xenforo2` | | |
12361242
`zendframework2` | | |

VERSION.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
version: 4.3.7
2+
version: 4.4.0
33
major:
44
description: "Catapult uses Semantic Versioning. During a MAJOR increment, incompatable API changes are made which require a manual upgrade path. Please follow these directions:"
55
notice: "NEW MAJOR VERSION OF CATAPULT AVAILABLE"

provisioners/provisioners.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,20 @@ software:
335335
version: [4]
336336
wordpress5:
337337
repo: "https://github.com/WordPress/WordPress.git"
338-
branch: "5.0-branch"
338+
branch: "5.9-branch"
339339
database_config_file: "wp-config.php"
340340
file_store_containers: ["wp-content"]
341341
file_stores: ["wp-content/languages","wp-content/uploads"]
342342
php_version: "7.2"
343343
version: [5]
344+
wordpress6:
345+
repo: "https://github.com/WordPress/WordPress.git"
346+
branch: "6.0-branch"
347+
database_config_file: "wp-config.php"
348+
file_store_containers: ["wp-content"]
349+
file_stores: ["wp-content/languages","wp-content/uploads"]
350+
php_version: "7.2"
351+
version: [6]
344352
xenforo1:
345353
repo: PRIVATE
346354
database_config_file: "config.php"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?php
2+
/** Enable W3 Total Cache */
3+
define('WP_CACHE', 'cache_here'); // Added by W3 Total Cache
4+
5+
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
6+
$ip = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
7+
$_SERVER['REMOTE_ADDR'] = $ip[0];
8+
}
9+
/**
10+
* The base configuration for WordPress
11+
*
12+
* The wp-config.php creation script uses this file during the installation.
13+
* You don't have to use the web site, you can copy this file to "wp-config.php"
14+
* and fill in the values.
15+
*
16+
* This file contains the following configurations:
17+
*
18+
* * Database settings
19+
* * Secret keys
20+
* * Database table prefix
21+
* * ABSPATH
22+
*
23+
* @link https://wordpress.org/support/article/editing-wp-config-php/
24+
*
25+
* @package WordPress
26+
*/
27+
28+
// ** Database settings - You can get this info from your web host ** //
29+
/** The name of the database for WordPress */
30+
define( 'DB_NAME', 'database_name_here' );
31+
32+
/** Database username */
33+
define( 'DB_USER', 'username_here' );
34+
35+
/** Database password */
36+
define( 'DB_PASSWORD', 'password_here' );
37+
38+
/** Database hostname */
39+
define( 'DB_HOST', 'localhost' );
40+
41+
/** Database charset to use in creating database tables. */
42+
define( 'DB_CHARSET', 'utf8' );
43+
44+
/** The database collate type. Don't change this if in doubt. */
45+
define( 'DB_COLLATE', '' );
46+
47+
/**#@+
48+
* Authentication unique keys and salts.
49+
*
50+
* Change these to different unique phrases! You can generate these using
51+
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
52+
*
53+
* You can change these at any point in time to invalidate all existing cookies.
54+
* This will force all users to have to log in again.
55+
*
56+
* @since 2.6.0
57+
*/
58+
define( 'AUTH_KEY', 'put your unique phrase here' );
59+
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
60+
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
61+
define( 'NONCE_KEY', 'put your unique phrase here' );
62+
define( 'AUTH_SALT', 'put your unique phrase here' );
63+
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
64+
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
65+
define( 'NONCE_SALT', 'put your unique phrase here' );
66+
67+
/**#@-*/
68+
69+
/**
70+
* WordPress database table prefix.
71+
*
72+
* You can have multiple installations in one database if you give each
73+
* a unique prefix. Only numbers, letters, and underscores please!
74+
*/
75+
$table_prefix = 'wp_';
76+
77+
/**
78+
* For developers: WordPress debugging mode.
79+
*
80+
* Change this to true to enable the display of notices during development.
81+
* It is strongly recommended that plugin and theme developers use WP_DEBUG
82+
* in their development environments.
83+
*
84+
* For information on other constants that can be used for debugging,
85+
* visit the documentation.
86+
*
87+
* @link https://wordpress.org/support/article/debugging-in-wordpress/
88+
*/
89+
define( 'WP_DEBUG', 'debug_here' );
90+
91+
/* Add any custom values between this line and the "stop editing" line. */
92+
93+
94+
95+
/* That's all, stop editing! Happy publishing. */
96+
97+
/** Absolute path to the WordPress directory. */
98+
if ( ! defined( 'ABSPATH' ) ) {
99+
define( 'ABSPATH', __DIR__ . '/' );
100+
}
101+
102+
/** Sets up WordPress vars and included files. */
103+
require_once ABSPATH . 'wp-settings.php';

provisioners/redhat/modules/git.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [ -d "/var/www/repositories/apache/${domain}/.git" ]; then
6666
sudo bash -c "echo \"_sql/*.sql\" >> \"/var/www/repositories/apache/${domain}/.gitignore\""
6767
fi
6868
# manage software ignores
69-
if [ "${software}" = "wordpress4" ] || [ "${software}" = "wordpress5" ]; then
69+
if ([ "${software}" = "wordpress4" ] || [ "${software}" = "wordpress5" ] || [ "${software}" = "wordpress6" ]); then
7070
git rm -rf --cached "/var/www/repositories/apache/${domain}/${webroot}wp-content/cache"
7171
git rm -rf --cached "/var/www/repositories/apache/${domain}/${webroot}wp-content/advanced-cache.php"
7272
git rm -rf --cached "/var/www/repositories/apache/${domain}/${webroot}wp-content/w3tc-config/master.php"

provisioners/redhat/modules/mysql_database_restore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if ([ ! -z "${software}" ]); then
130130
echo -e "\t- replacing URLs in the database to align with the environment..."
131131
wp-cli-php71 --allow-root --path="/var/www/repositories/apache/${domain}/${webroot}" search-replace ":\/\/(www\.)?(dev\.|test\.|qc\.)?(${domain_url_replace})" "://\$1${domain_url}" --regex | sed "s/^/\t\t/"
132132
fi
133-
if ([ "${software}" = "wordpress5" ]); then
133+
if ([ "${software}" = "wordpress5" ] || [ "${software}" = "wordpress6" ]); then
134134
echo -e "\t- replacing URLs in the database to align with the environment..."
135135
wp-cli-php72 --allow-root --path="/var/www/repositories/apache/${domain}/${webroot}" search-replace ":\/\/(www\.)?(dev\.|test\.|qc\.)?(${domain_url_replace})" "://\$1${domain_url}" --regex | sed "s/^/\t\t/"
136136
fi

provisioners/redhat/modules/software_operations_file.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,31 @@ if hash composer 2>/dev/null && hash drush 2>/dev/null && hash wp-cli 2>/dev/nul
357357
if [ "${software_auto_update}" = "true" ]; then
358358
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root theme update --all
359359
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin update --all
360-
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root core update
360+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root core update --version=5.9
361+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin update --all
362+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root theme update --all
363+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin install w3-total-cache
364+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin activate w3-total-cache
365+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache fix_environment apache
366+
else
367+
sed -i "/\/\*\* Enable W3 Total Cache \*\//d" "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}/wp-config.php"
368+
sed -i "/define( 'WP_CACHE' , true ); \/\/ Added by W3 Total Cache/d" "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}/wp-config.php"
369+
fi
370+
371+
else
372+
echo -e "\nSUPPORTED SOFTWARE NOT DETECTED\n"
373+
fi
374+
375+
elif [ "${software}" = "wordpress6" ]; then
376+
377+
version=$(cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && cat wp-includes/version.php 2>/dev/null | grep "\$wp_version" | grep --extended-regexp --only-matching --regexp="[0-9]\.[0-9][0-9]?[0-9]?(\.[0-9][0-9]?[0-9]?)?" || echo "0")
378+
if [[ "${softwareversion_array[@]}" =~ "$(grep --only-matching --regexp="^[0-9]" <<< "${version}")" ]]; then
379+
echo -e "\nSUPPORTED SOFTWARE VERSION DETECTED: ${version}\n"
380+
381+
if [ "${software_auto_update}" = "true" ]; then
382+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root theme update --all
383+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin update --all
384+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root core update --version=6.9
361385
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin update --all
362386
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root theme update --all
363387
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root plugin install w3-total-cache

provisioners/redhat/modules/software_operations_meta.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ elif [ "${software}" = "wordpress5" ]; then
187187
"
188188
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root user add-role 1 administrator
189189

190+
elif [ "${software}" = "wordpress6" ]; then
191+
192+
mysql --defaults-extra-file=$dbconf ${1}_${domain_valid_db_name} -e "UPDATE ${software_dbprefix}options SET option_value='$(catapult company.email)' WHERE option_name = 'admin_email';"
193+
194+
mysql --defaults-extra-file=$dbconf ${1}_${domain_valid_db_name} -e "
195+
INSERT INTO ${software_dbprefix}users (id, user_login, user_pass, user_nicename, user_email, user_status, display_name)
196+
VALUES ('1', 'admin', MD5('$(catapult environments.${1}.software.wordpress.admin_password)'), 'admin', '$(catapult company.email)', '0', 'admin')
197+
ON DUPLICATE KEY UPDATE user_login='admin', user_pass=MD5('$(catapult environments.${1}.software.wordpress.admin_password)'), user_nicename='admin', user_email='$(catapult company.email)', user_status='0', display_name='admin';
198+
"
199+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root user add-role 1 administrator
200+
190201
elif [ "${software}" = "xenforo2" ]; then
191202

192203
mysql --defaults-extra-file=$dbconf ${1}_${domain_valid_db_name} -e "
@@ -463,6 +474,29 @@ elif [ "${software}" = "wordpress5" ]; then
463474
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache fix_environment apache
464475
fi
465476

477+
elif [ "${software}" = "wordpress6" ]; then
478+
479+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root core update-db
480+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root cache flush
481+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root yoast index --reindex --skip-confirmation
482+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache flush all
483+
484+
# caching is always disabled in dev while page cache is enabled in all other environments
485+
if [ "$1" = "dev" ]; then
486+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set pgcache.enabled false --type=boolean
487+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set dbcache.enabled false --type=boolean
488+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set objectcache.enabled false --type=boolean
489+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set browsercache.enabled false --type=boolean
490+
sed -i "/\/\*\* Enable W3 Total Cache \*\//d" "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}/wp-config.php"
491+
sed -i "/define( 'WP_CACHE' , true ); \/\/ Added by W3 Total Cache/d" "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}/wp-config.php"
492+
else
493+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set pgcache.enabled true --type=boolean
494+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set dbcache.enabled false --type=boolean
495+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set objectcache.enabled false --type=boolean
496+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache option set browsercache.enabled false --type=boolean
497+
cd "/var/www/repositories/apache/${domain}/${webroot}${softwareroot}" && wp-cli-php72 --allow-root w3-total-cache fix_environment apache
498+
fi
499+
466500
elif [ "${software}" = "xenforo1" ]; then
467501

468502
echo "nothing to perform, skipping..."

0 commit comments

Comments
 (0)