Refactor database and application start scripts
This commit is contained in:
parent
5e7c6906b3
commit
27b18fbedf
@ -68,7 +68,7 @@ class StartMariadb
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->database->limits_cpuset !== 0) {
|
||||
if (!is_null($this->database->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
|
||||
}
|
||||
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
|
||||
|
@ -75,7 +75,7 @@ class StartMongodb
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->database->limits_cpuset !== 0) {
|
||||
if (!is_null($this->database->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
|
||||
}
|
||||
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
|
||||
@ -123,7 +123,7 @@ class StartMongodb
|
||||
$this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml pull";
|
||||
$this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d";
|
||||
$this->commands[] = "echo '{$database->name} started.'";
|
||||
return remote_process($this->commands, $database->destination->server,callEventOnFinish: 'DatabaseStatusChanged');
|
||||
return remote_process($this->commands, $database->destination->server, callEventOnFinish: 'DatabaseStatusChanged');
|
||||
}
|
||||
|
||||
private function generate_local_persistent_volumes()
|
||||
|
@ -68,7 +68,7 @@ class StartMysql
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->database->limits_cpuset !== 0) {
|
||||
if (!is_null($this->database->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
|
||||
}
|
||||
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
|
||||
|
@ -78,7 +78,7 @@ class StartPostgresql
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->database->limits_cpuset !== 0) {
|
||||
if (!is_null($this->database->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
|
||||
}
|
||||
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
|
||||
|
@ -77,7 +77,7 @@ class StartRedis
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->database->limits_cpuset !== 0) {
|
||||
if (!is_null($this->database->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
|
||||
}
|
||||
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
|
||||
|
@ -1027,7 +1027,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->application->limits_cpuset !== 0) {
|
||||
if (!is_null($this->application->limits_cpuset)) {
|
||||
data_set($docker_compose, 'services.' . $this->container_name . '.cpuset', $this->application->limits_cpuset);
|
||||
}
|
||||
if ($this->server->isSwarm()) {
|
||||
|
@ -653,7 +653,7 @@ class Application extends BaseModel
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($this->limits_cpuset !== 0) {
|
||||
if (!is_null($this->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$container_name}.cpuset", $this->limits_cpuset);
|
||||
}
|
||||
if ($server->isSwarm()) {
|
||||
|
@ -178,7 +178,7 @@ function generateComposeFile(string $deploymentUuid, Server $server, string $net
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($application->limits_cpuset !== 0) {
|
||||
if (!is_null($application->limits_cpuset)) {
|
||||
data_set($docker_compose, "services.{$containerName}.cpuset", $application->limits_cpuset);
|
||||
}
|
||||
if ($server->isLogDrainEnabled() && $application->isLogDrainEnabled()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user