Skip to content

Commit

Permalink
Add the ability to update the site deployment script during deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
owenconti committed Jan 11, 2024
1 parent 5111eed commit 2b24053
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Commands/DeploySite.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class DeploySite extends Command
{branch : The name of the branch to deploy}
{subdomain : The subdomain to use for the site and the site\'s database)}
{php-version : The PHP version to use (php82, php81, php80, php74)}
{env : Base64 encoded .env file to use for the site}';
{env : Base64 encoded .env file to use for the site}
{deployment-script? : The deployment script to use (optional)}';

protected $description = 'Deploys the given branch to the server.';

Expand Down Expand Up @@ -84,6 +85,11 @@ protected function createSite(): Site

protected function deploySite(Site $site): void
{
if ($deploymentScript = $this->argument('deployment-script')) {
$this->output->info('Updating deployment script...');
$this->forge->updateSiteDeploymentScript($this->forgeServerId, $site->id, base64_decode($deploymentScript));
}

$this->output->info('Updating site .env file...');
$this->forge->updateSiteEnvironmentFile($this->forgeServerId, $site->id, base64_decode($this->argument('env')));

Expand Down
Binary file modified builds/forge-review-apps
Binary file not shown.

0 comments on commit 2b24053

Please sign in to comment.