test add_coolif_default_environment_variables
This commit is contained in:
@@ -160,20 +160,7 @@ class StartClickhouse
|
||||
$environment_variables->push("CLICKHOUSE_ADMIN_PASSWORD={$this->database->clickhouse_admin_password}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
@@ -163,20 +163,7 @@ class StartKeydb
|
||||
$environment_variables->push("REDIS_PASSWORD={$this->database->keydb_password}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
@@ -169,20 +169,7 @@ class StartMariadb
|
||||
$environment_variables->push("MARIADB_PASSWORD={$this->database->mariadb_password}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
@@ -182,20 +182,7 @@ class StartMongodb
|
||||
$environment_variables->push("MONGO_INITDB_DATABASE={$this->database->mongo_initdb_database}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
@@ -169,20 +169,7 @@ class StartMysql
|
||||
$environment_variables->push("MYSQL_PASSWORD={$this->database->mysql_password}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
@@ -191,20 +191,7 @@ class StartPostgresql
|
||||
$environment_variables->push("POSTGRES_DB={$this->database->postgres_db}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
@@ -168,20 +168,7 @@ class StartRedis
|
||||
$environment_variables->push("REDIS_PASSWORD={$this->database->redis_password}");
|
||||
}
|
||||
|
||||
// TODO: move this in a shared function
|
||||
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
|
||||
}
|
||||
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
|
||||
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
|
||||
}
|
||||
|
||||
add_coolify_default_environment_variables($this->database, $environment_variables, $environment_variables);
|
||||
|
||||
return $environment_variables->all();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user