add env vars for db services 😢

This commit is contained in:
Vahor committed 2024-08-27 18:57:02 +02:00
1 parent eb22155dcc
commit a245d16e05
7 files changed
+105

No files matched your search

+15
View File
@@ -168,6 +168,21 @@ 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}");
}
return $environment_variables->all();
}
}
+15
View File
@@ -171,6 +171,21 @@ 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}");
}
return $environment_variables->all();
}
+15
View File
@@ -177,6 +177,21 @@ 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}");
}
return $environment_variables->all();
}
+15
View File
@@ -190,6 +190,21 @@ 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}");
}
return $environment_variables->all();
}
+15
View File
@@ -177,6 +177,21 @@ 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}");
}
return $environment_variables->all();
}
+15
View File
@@ -199,6 +199,21 @@ 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}");
}
return $environment_variables->all();
}
+15
View File
@@ -176,6 +176,21 @@ 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}");
}
return $environment_variables->all();
}