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) {

View File

@@ -9,14 +9,14 @@ return new class extends Migration
public function up()
{
Schema::table('applications', function (Blueprint $table) {
$table->text('network_aliases')->nullable();
$table->text('custom_network_aliases')->nullable();
});
}
public function down()
{
Schema::table('applications', function (Blueprint $table) {
$table->dropColumn('network_aliases');
$table->dropColumn('custom_network_aliases');
});
}
};

View File

@@ -343,9 +343,9 @@
helper="A comma separated list of ports you would like to map to the host system. Useful when you do not want to use domains.<br><br><span class='inline-block font-bold dark:text-warning'>Example:</span><br>3000:3000,3002:3002<br><br>Rolling update is not supported if you have a port mapped to the host." />
@endif
@if (!$application->destination->server->isSwarm())
<x-forms.input id="application.network_aliases" label="Network Aliases"
<x-forms.input id="application.custom_network_aliases" label="Network Aliases"
helper="A comma separated list of custom network aliases you would like to add for container in Docker network.<br><br><span class='inline-block font-bold dark:text-warning'>Example:</span><br>api.internal,api.local"
wire:model="application.network_aliases" />
wire:model="application.custom_network_aliases" />
@endif
</div>