diff --git a/README.md b/README.md index 58cd84a..fb9ab1d 100644 --- a/README.md +++ b/README.md @@ -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); @@ -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); diff --git a/src/Actions/ManagesSites.php b/src/Actions/ManagesSites.php index e8d4e69..30f7b3e 100644 --- a/src/Actions/ManagesSites.php +++ b/src/Actions/ManagesSites.php @@ -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. * diff --git a/src/Resources/Site.php b/src/Resources/Site.php index 024739e..0d8bd53 100644 --- a/src/Resources/Site.php +++ b/src/Resources/Site.php @@ -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. *