Skip to content

Commit

Permalink
Add extra argument for subdomain in addition to the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
owenconti committed Jan 11, 2024
1 parent 022df82 commit df48e3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/Commands/DeleteSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DeleteSite extends Command
{forge-cli-token : The Forge CLI token to use}
{forge-server-id : The Forge server ID to use}
{root-domain : The root domain to use (example.com)}
{branch : The name of the branch to delete.}';
{subdomain : The subdomain of the site}';

protected $description = 'Deletes the site on the server, including the database.';

Expand All @@ -24,7 +24,7 @@ class DeleteSite extends Command
public function handle(): void
{
$this->buildForge();
$this->domain = $this->argument('branch') . '.' . $this->argument('root-domain');
$this->domain = $this->argument('subdomain') . '.' . $this->argument('root-domain');

try {
$this->deleteSite();
Expand Down
9 changes: 5 additions & 4 deletions app/Commands/DeploySite.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ class DeploySite extends Command
{
protected $signature = 'app:deploy-site
{forge-cli-token : The Forge CLI token to use}
{forge-server-id : The Forge server ID to use}
{forge-server-id : The Forge server ID to use}
{root-domain : The root domain to use (example.com)}
{git-provider : The git provider to use (github, gitlab)}
{repository : The repository to use (username/repository)}
{branch : The name of the branch to deploy (will be used for the subdomain and database name)}
{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}';

Expand All @@ -29,7 +30,7 @@ class DeploySite extends Command
public function handle(): void
{
$this->buildForge();
$this->domain = $this->argument('branch') . '.' . $this->argument('root-domain');
$this->domain = $this->argument('subdomain') . '.' . $this->argument('root-domain');

try {
$site = $this->getSite();
Expand Down Expand Up @@ -58,7 +59,7 @@ protected function createSite(): Site

$site = $this->forge->createSite($this->forgeServerId, [
'domain' => $this->domain,
'database' => $this->argument('branch'),
'database' => $this->argument('subdomain'),
'project_type' => 'php',
'php_version' => $this->argument('php-version'),
'aliases' => [],
Expand Down
Binary file modified builds/forge-review-apps
Binary file not shown.

0 comments on commit df48e3b

Please sign in to comment.