Skip to content

Commit

Permalink
Fix deploy webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Dargham committed Mar 21, 2023
1 parent 99407bf commit 09b687b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/DeployTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Globalis\WP\Cubi\Robo;

use Globalis\Robo\Core\Command;

trait DeployTrait
{
public function deploy($environment, $gitRevision, $options = ['ignore-assets' => false, 'ignore-composer' => false])
Expand Down Expand Up @@ -51,6 +53,7 @@ public function deploy($environment, $gitRevision, $options = ['ignore-assets' =

if ($deployed) {
$site_url = $config['WEB_SCHEME'] . '://' . $config['WEB_DOMAIN'] . $config['WEB_PATH'];
$site_url = self::trailingslashit($site_url);

$this->io()->newLine();

Expand All @@ -77,7 +80,7 @@ public function deploy($environment, $gitRevision, $options = ['ignore-assets' =

// Ping home url to generate new cache

$cmd = new Command('curl');
$cmd = new Command('curl -S -s -o /dev/null');
$cmd = $cmd->arg($site_url)
->getCommand();

Expand Down Expand Up @@ -290,7 +293,7 @@ protected function rsync($fromHost, $fromUser, $fromPath, $toHost, $toUser, $toP

protected function sendWebhookHttpRequest($site_url, $webhook)
{
$url = $site_url;
$url = self::trailingslashit($site_url);
$url .= "?wp-cubi-webhooks-run=" . $webhook;
$url .= "&wp-cubi-webhooks-secret=" . \RoboFile::WP_CUBI_WEBHOOKS_SECRET;

Expand Down

0 comments on commit 09b687b

Please sign in to comment.