mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-05 09:14:58 +03:00
✨ feat(administration): add delivery-aware administration
This commit is contained in:
1 parent
356767c6b7
commit
f8fb9162a6
39 files changed
+1917
-11
No files matched your search
+21
-1
@@ -1,3 +1,8 @@
|
||||
param(
|
||||
[ValidateSet("Cloud", "SelfHosted")]
|
||||
[string]$Mode = "Cloud"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (-not (Test-Path ".env")) {
|
||||
@@ -5,4 +10,19 @@ if (-not (Test-Path ".env")) {
|
||||
}
|
||||
|
||||
# Dev-контур: canonical compose.yaml + dev override (ADR-HUB-0028).
|
||||
docker compose -f compose.yaml -f compose.dev.yaml --env-file .env.example --env-file .env up --build
|
||||
# Режим поставки задаётся процессу Compose и не переписывает локальный .env.
|
||||
$deliveryMode = if ($Mode -eq "SelfHosted") { "SELF_HOSTED" } else { "CLOUD" }
|
||||
$previousDeliveryMode = $env:CUS_DELIVERY_MODE
|
||||
$env:CUS_DELIVERY_MODE = $deliveryMode
|
||||
|
||||
try {
|
||||
docker compose -f compose.yaml -f compose.dev.yaml --env-file .env.example --env-file .env up --build
|
||||
}
|
||||
finally {
|
||||
if ($null -eq $previousDeliveryMode) {
|
||||
Remove-Item Env:CUS_DELIVERY_MODE -ErrorAction SilentlyContinue
|
||||
}
|
||||
else {
|
||||
$env:CUS_DELIVERY_MODE = $previousDeliveryMode
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user