refactor(Application): rename network_aliases to custom_network_aliases across the application for clarity and consistency
This commit is contained in:
@@ -329,7 +329,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
} else {
|
} else {
|
||||||
$this->write_deployment_configurations();
|
$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);
|
$this->graceful_shutdown_container($this->deployment_uuid);
|
||||||
|
|
||||||
ApplicationStatusChanged::dispatch(data_get($this->application, 'environment.project.team.id'));
|
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'));
|
$this->application->parseHealthcheckFromDockerfile($this->saved_outputs->get('dockerfile_from_repo'));
|
||||||
}
|
}
|
||||||
$network_aliases = [];
|
$custom_network_aliases = [];
|
||||||
if (is_array($this->application->network_aliases) && count($this->application->network_aliases) > 0) {
|
if (is_array($this->application->custom_network_aliases) && count($this->application->custom_network_aliases) > 0) {
|
||||||
$network_aliases = $this->application->network_aliases;
|
$custom_network_aliases = $this->application->custom_network_aliases;
|
||||||
}
|
}
|
||||||
ray($network_aliases);
|
|
||||||
$docker_compose = [
|
$docker_compose = [
|
||||||
'services' => [
|
'services' => [
|
||||||
$this->container_name => [
|
$this->container_name => [
|
||||||
@@ -1725,7 +1724,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
$this->destination->network => [
|
$this->destination->network => [
|
||||||
'aliases' => array_merge(
|
'aliases' => array_merge(
|
||||||
[$this->container_name],
|
[$this->container_name],
|
||||||
$network_aliases
|
$custom_network_aliases
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@@ -68,7 +68,7 @@ class General extends Component
|
|||||||
'application.publish_directory' => 'nullable',
|
'application.publish_directory' => 'nullable',
|
||||||
'application.ports_exposes' => 'required',
|
'application.ports_exposes' => 'required',
|
||||||
'application.ports_mappings' => 'nullable',
|
'application.ports_mappings' => 'nullable',
|
||||||
'application.network_aliases' => 'nullable',
|
'application.custom_network_aliases' => 'nullable',
|
||||||
'application.dockerfile' => 'nullable',
|
'application.dockerfile' => 'nullable',
|
||||||
'application.docker_registry_image_name' => 'nullable',
|
'application.docker_registry_image_name' => 'nullable',
|
||||||
'application.docker_registry_image_tag' => 'nullable',
|
'application.docker_registry_image_tag' => 'nullable',
|
||||||
|
@@ -45,7 +45,7 @@ use Visus\Cuid2\Cuid2;
|
|||||||
'start_command' => ['type' => 'string', 'description' => 'Start command.'],
|
'start_command' => ['type' => 'string', 'description' => 'Start command.'],
|
||||||
'ports_exposes' => ['type' => 'string', 'description' => 'Ports exposes.'],
|
'ports_exposes' => ['type' => 'string', 'description' => 'Ports exposes.'],
|
||||||
'ports_mappings' => ['type' => 'string', 'nullable' => true, 'description' => 'Ports mappings.'],
|
'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.'],
|
'base_directory' => ['type' => 'string', 'description' => 'Base directory for all commands.'],
|
||||||
'publish_directory' => ['type' => 'string', 'description' => 'Publish directory.'],
|
'publish_directory' => ['type' => 'string', 'description' => 'Publish directory.'],
|
||||||
'health_check_enabled' => ['type' => 'boolean', 'description' => 'Health check enabled.'],
|
'health_check_enabled' => ['type' => 'boolean', 'description' => 'Health check enabled.'],
|
||||||
@@ -116,9 +116,9 @@ class Application extends BaseModel
|
|||||||
|
|
||||||
protected $appends = ['server_status'];
|
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(
|
return Attribute::make(
|
||||||
set: function ($value) {
|
set: function ($value) {
|
||||||
|
@@ -9,14 +9,14 @@ return new class extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('applications', function (Blueprint $table) {
|
Schema::table('applications', function (Blueprint $table) {
|
||||||
$table->text('network_aliases')->nullable();
|
$table->text('custom_network_aliases')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('applications', function (Blueprint $table) {
|
Schema::table('applications', function (Blueprint $table) {
|
||||||
$table->dropColumn('network_aliases');
|
$table->dropColumn('custom_network_aliases');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -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." />
|
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
|
@endif
|
||||||
@if (!$application->destination->server->isSwarm())
|
@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"
|
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
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user