-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.ps1
40 lines (25 loc) · 1.2 KB
/
start.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Param(
[string]$LOG_PATH = ".\logs",
[string]$LOG_PEFIX = "start",
[string]$LOG_SUFFIX = ".log",
[string]$FUNCTIONS_URI = "https://github.com/aem-design/aemdesign-docker/releases/latest/download/functions.ps1",
[string]$SERVICES = "$( (Get-Content ".\start-services.conf" | Where-Object {$_ -notmatch '^#.*'} | Where-Object {-not([String]::IsNullOrWhiteSpace($_))} ) -join " --file ")",
[string]$PORT = "443",
[Parameter(Position=0)]
[string]$SERVICE_NAME = "" # services to start
)
$SKIP_CONFIG = $true
$PARENT_PROJECT_PATH = "."
. ([Scriptblock]::Create((([System.Text.Encoding]::ASCII).getString((Invoke-WebRequest -Uri "${FUNCTIONS_URI}").Content))))
# get env config
$CONFIG_ENV = (Get-Content ".env" -Raw | ConvertFrom-StringData)
$PORT=$CONFIG_ENV.TRAEFIK_HTTP_PORT
$DOCKER_COMMAND="docker-compose --env-file .env --file docker-compose.yml --file ${SERVICES} up ${SERVICE_NAME}"
if ( [string]::IsNullOrEmpty(${SERVICE_NAME}) ) {
$OPEN_COMMAND="explorer https://localhost"
printSubSectionStart "Open Console at https://localhost"
Invoke-Expression "${OPEN_COMMAND}"
}
printSubSectionStart "Docker Compose Execute"
printSectionLine "${DOCKER_COMMAND}"
Invoke-Expression "${DOCKER_COMMAND}"