Skip to content

Commit

Permalink
Add WP version check before deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Dargham committed Jun 23, 2023
1 parent c44fb6d commit 838270b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/DeployTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ public function deploy($environment, $gitRevision, $options = ['ignore-assets' =
$options['ignore-composer'] = false;
}

if (!empty($this->wpShowAvailablePatch())) {
$this->io()->warning("You are about to deploy an outdated version of WordPress core.\nFor security purposes, it is recommended to update to latest patch first.\n\nRun following command to run composer update :\n\n./vendor/bin/robo wp:apply-available-patch\n\nNote: major and minor version won't change.\n");
if ($this->io()->confirm('Abort deployment ?', true)) {
exit;
}
}

$this->io()->title('Deploy version ' . $gitRevision . ' to ' . $environment);

if (!file_exists($this->fileVarsLocal($environment)) || \RoboFile::CONFIRM_CONFIG_BEFORE_DEPLOY) {
Expand Down

0 comments on commit 838270b

Please sign in to comment.