refactor(Application): rename network_aliases to custom_network_aliases across the application for clarity and consistency

This commit is contained in:
Andras Bacsai
2025-04-09 08:42:50 +02:00
parent fcf597fb16
commit 68bd945b09
5 changed files with 13 additions and 14 deletions

View File

@@ -329,7 +329,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
} else {
$this->write_deployment_configurations();
}
$this->application_deployment_queue->addLogEntry("Starting graceful shutdown container: {$this->deployment_uuid}");
$this->application_deployment_queue->addLogEntry("Gracefully shutting down build container: {$this->deployment_uuid}");
$this->graceful_shutdown_container($this->deployment_uuid);
ApplicationStatusChanged::dispatch(data_get($this->application, 'environment.project.team.id'));
@@ -1709,11 +1709,10 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
]);
$this->application->parseHealthcheckFromDockerfile($this->saved_outputs->get('dockerfile_from_repo'));
}
$network_aliases = [];
if (is_array($this->application->network_aliases) && count($this->application->network_aliases) > 0) {
$network_aliases = $this->application->network_aliases;
$custom_network_aliases = [];
if (is_array($this->application->custom_network_aliases) && count($this->application->custom_network_aliases) > 0) {
$custom_network_aliases = $this->application->custom_network_aliases;
}
ray($network_aliases);
$docker_compose = [
'services' => [
$this->container_name => [
@@ -1725,7 +1724,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
$this->destination->network => [
'aliases' => array_merge(
[$this->container_name],
$network_aliases
$custom_network_aliases
),
],
],

View File

@@ -68,7 +68,7 @@ class General extends Component
'application.publish_directory' => 'nullable',
'application.ports_exposes' => 'required',
'application.ports_mappings' => 'nullable',
'application.network_aliases' => 'nullable',
'application.custom_network_aliases' => 'nullable',
'application.dockerfile' => 'nullable',
'application.docker_registry_image_name' => 'nullable',
'application.docker_registry_image_tag' => 'nullable',

View File

@@ -45,7 +45,7 @@ use Visus\Cuid2\Cuid2;
'start_command' => ['type' => 'string', 'description' => 'Start command.'],
'ports_exposes' => ['type' => 'string', 'description' => 'Ports exposes.'],
'ports_mappings' => ['type' => 'string', 'nullable' => true, 'description' => 'Ports mappings.'],
'network_aliases' => ['type' => 'string', 'nullable' => true, 'description' => 'Network aliases for Docker container.'],
'custom_network_aliases' => ['type' => 'string', 'nullable' => true, 'description' => 'Network aliases for Docker container.'],
'base_directory' => ['type' => 'string', 'description' => 'Base directory for all commands.'],
'publish_directory' => ['type' => 'string', 'description' => 'Publish directory.'],
'health_check_enabled' => ['type' => 'boolean', 'description' => 'Health check enabled.'],
@@ -116,9 +116,9 @@ class Application extends BaseModel
protected $appends = ['server_status'];
protected $casts = ['network_aliases' => 'array'];
protected $casts = ['custom_network_aliases' => 'array'];
public function networkAliases(): Attribute
public function customNetworkAliases(): Attribute
{
return Attribute::make(
set: function ($value) {