Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Add deployment history #131

Merged
merged 3 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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