Skip to content

Commit

Permalink
[3.x] Add deployment history (#131)
Browse files Browse the repository at this point in the history
* added deployment history

* fixed styleci

* Apply suggestions from code review

Co-authored-by: James Brooks <[email protected]>

Co-authored-by: James Brooks <[email protected]>
  • Loading branch information
tobischulz and jbrooksuk authored Nov 22, 2021
1 parent 3f1be7a commit 920ffda
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ $forge->disableQuickDeploy($serverId, $siteId);
$forge->deploySite($serverId, $siteId, $wait = false);
$forge->resetDeploymentState($serverId, $siteId);
$forge->siteDeploymentLog($serverId, $siteId);
$forge->deploymentHistory($serverId, $siteId);
$forge->deploymentHistoryDeployment($serverId, $siteId, $deploymentId);
$forge->deploymentHistoryOutput($serverId, $siteId, $deploymentId);

// PHP Version
$forge->changeSitePHPVersion($serverId, $siteId, $version);
Expand Down Expand Up @@ -292,6 +295,9 @@ $site->disableQuickDeploy();
$site->deploySite($wait = false);
$site->resetDeploymentState();
$site->siteDeploymentLog();
$site->getDeploymentHistory();
$site->getDeploymentHistoryDeployment($deploymentId);
$site->getDeploymentHistoryOutput($deploymentId);
$site->installWordPress($data);
$site->removeWordPress();
$site->installPhpMyAdmin($data);
Expand Down
38 changes: 38 additions & 0 deletions src/Actions/ManagesSites.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,44 @@ public function siteDeploymentLog($serverId, $siteId)
return $this->get("servers/$serverId/sites/$siteId/deployment/log");
}

/**
* Get the deployment history of the site.
*
* @param int $serverId
* @param int $siteId
* @return string
*/
public function deploymentHistory($serverId, $siteId)
{
return $this->get("/api/v1/servers/$serverId/sites/$siteId/deployment-history");
}

/**
* Get a single deployment from the deployment history of a site.
*
* @param int $serverId
* @param int $siteId
* @param int $deploymentId
* @return string
*/
public function deploymentHistoryDeployment($serverId, $siteId, $deploymentId)
{
return $this->get("/api/v1/servers/$serverId/sites/$siteId/deployment-history/$deploymentId");
}

/**
* Get the output for a deployment of the site.
*
* @param int $serverId
* @param int $siteId
* @param int $deploymentId
* @return string
*/
public function deploymentHistoryOutput($serverId, $siteId, $deploymentId)
{
return $this->get("/api/v1/servers/$serverId/sites/$siteId/deployment-history/$deploymentId/output");
}

/**
* Enable Hipchat Notifications for the given site.
*
Expand Down
32 changes: 32 additions & 0 deletions src/Resources/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,38 @@ public function siteDeploymentLog()
return $this->forge->siteDeploymentLog($this->serverId, $this->id);
}

/**
* Get the deployments history of the site.
*
* @return string
*/
public function getDeploymentHistory()
{
return $this->forge->deploymentHistory($this->serverId, $this->id);
}

/**
* Get a single deployment from the deployment history of a site.
*
* @param int $deploymentId
* @return string
*/
public function getDeploymentHistoryDeployment($deploymentId)
{
return $this->forge->deploymentHistoryDeployment($this->serverId, $this->id, $deploymentId);
}

/**
* Get the output for a deployment of the site.
*
* @param int $deploymentId
* @return string
*/
public function getDeploymentHistoryOutput($deploymentId)
{
return $this->forge->deploymentHistoryOutput($this->serverId, $this->id, $deploymentId);
}

/**
* Enable Hipchat Notifications for the given site.
*
Expand Down

0 comments on commit 920ffda

Please sign in to comment.