Skip to content

Commit d239317

Browse files
authored
Merge pull request #22 from rtCamp/add/core-update-db
Add wp core update-db in deployment custom task
2 parents fc3d83c + b6e9cff commit d239317

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

deploy.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,28 @@
9696

9797
});
9898

99+
desc('Upgrade WordPress DB');
100+
task('core_db:update', function () {
101+
102+
$ee_version = run('ee --version');
103+
104+
if ( false !== strpos( $ee_version, 'EasyEngine v3' ) ) {
105+
106+
$output = run('cd {{release_path}} && wp core update-db');
107+
108+
} elseif ( false !== strpos( $ee_version, 'EE 4' ) ) {
109+
110+
cd( '{{deploy_path}}' );
111+
$output = run( 'cd current && ee shell --command="wp core update-db" --skip-tty' );
112+
113+
} else {
114+
echo 'Skipping WordPress db core update as EasyEnigne is not installed.';
115+
}
116+
117+
writeln('<info>' . $output . '</info>');
118+
119+
});
120+
99121
desc('Symlink wp-config.php');
100122
task('wp:config', function () {
101123
run('[ ! -f {{release_path}}/../wp-config.php ] && cd {{release_path}}/../ && ln -sn ../wp-config.php && echo "Created Symlink for wp-config.php." || echo ""');
@@ -125,6 +147,7 @@
125147
'deploy:symlink',
126148
'permissions:set',
127149
'opcache:reset',
150+
'core_db:update',
128151
'deploy:unlock',
129152
'cleanup'
130153
]);

0 commit comments

Comments
 (0)