Skip to content
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
10 changes: 5 additions & 5 deletions app/Console/Site/SiteAddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var string $permissions */

//
// Validate server is ready for site provisioning
// Validate server is ready to add site
// ----

$validationResult = $this->validateServerReady($server->info);
Expand Down Expand Up @@ -112,13 +112,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->displaySiteDeets($site);

//
// Provision site on server
// Add site on server
// ----

$result = $this->executePlaybookSilently(
$server,
'site-add',
'Provisioning site...',
'Adding site...',
[
'DEPLOYER_DISTRO' => $distro,
'DEPLOYER_PERMS' => $permissions,
Expand All @@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return $result;
}

$this->yay('Site provisioned successfully');
$this->yay('Site added successfully');

//
// Save to inventory
Expand Down Expand Up @@ -188,7 +188,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// ----

/**
* Validate that server is ready for site provisioning.
* Validate that server is ready to add site.
*
* Checks for:
* - Caddy web server installed
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Site/SiteDeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var string $permissions */

//
// Validate site is provisioned on server
// Validate site is added on server
// ----

$validationResult = $this->validateSiteProvisioned($server, $site);
$validationResult = $this->validateSiteAdded($server, $site);

if (is_int($validationResult)) {
return $validationResult;
Expand Down
6 changes: 3 additions & 3 deletions app/Console/Site/SiteHttpsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->warn("Site '{$site->domain}' configuration not found on server");
$this->out([
'',
'It looks like this site has not been provisioned yet.',
'Run <fg=cyan>site:add</> to provision the site first.',
'It looks like this site has not been added yet.',
'Run <fg=cyan>site:add</> to add the site first.',
'',
]);

return Command::SUCCESS;
}

if ($config['php_version'] === 'unknown') {
$this->nay("Could not detect PHP version for '{$site->domain}' from server config; re-provision the site or run server:info to debug.");
$this->nay("Could not detect PHP version for '{$site->domain}' from server config; re-add the site or run server:info to debug.");

return Command::FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Site/SiteSharedPullCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

//
// Validate site is provisioned on server
// Validate site is added on server
// ----

$validationResult = $this->validateSiteProvisioned($server, $site);
$validationResult = $this->validateSiteAdded($server, $site);

if (is_int($validationResult)) {
return $validationResult;
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Site/SiteSharedPushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var string $permissions */

//
// Validate site is provisioned on server
// Validate site is added on server
// ----

$validationResult = $this->validateSiteProvisioned($server, $site);
$validationResult = $this->validateSiteAdded($server, $site);

if (is_int($validationResult)) {
return $validationResult;
Expand Down
8 changes: 4 additions & 4 deletions app/Traits/SitesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ protected function validateSiteRepo(mixed $repo): ?string
}

/**
* Validate that site has been provisioned on the server.
* Validate that site has been added on the server.
*
* Checks for:
* - Site directory structure exists at /home/deployer/sites/{domain}
* - Caddy configuration file exists
*
* @return int|null Returns Command::FAILURE if validation fails, null if successful
*/
protected function validateSiteProvisioned(ServerDTO $server, SiteDTO $site): ?int
protected function validateSiteAdded(ServerDTO $server, SiteDTO $site): ?int
{
try {
$result = $this->ssh->executeCommand(
Expand All @@ -241,9 +241,9 @@ protected function validateSiteProvisioned(ServerDTO $server, SiteDTO $site): ?i
);

if ($result['exit_code'] !== 0) {
$this->nay("Site '{$site->domain}' has not been provisioned on the server");
$this->nay("Site '{$site->domain}' has not been added on the server");
$this->out([
'Run <fg=cyan>site:add</> to provision the site first.',
'Run <fg=cyan>site:add</> to add the site first.',
'',
]);

Expand Down
2 changes: 1 addition & 1 deletion playbooks/site-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Site Add Playbook - Ubuntu/Debian Only
#
# Provision new site with atomic deployment directory structure
# Add new site with atomic deployment directory structure
# ----
#
# This playbook only supports Ubuntu and Debian distributions (debian family).
Expand Down
2 changes: 1 addition & 1 deletion playbooks/site-https.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ----
#
# This playbook only supports Ubuntu and Debian distributions (debian family).
# Requires site to be already provisioned.
# Requires site to be already added.
#
# Required Environment Variables:
# DEPLOYER_OUTPUT_FILE - Output file path
Expand Down