-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
deploy.ps1
44 lines (33 loc) · 1.37 KB
/
deploy.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
39
40
41
42
43
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "deploy",
[string]$LOG_SUFFIX = ".log",
[string]$DOCKER_LOGS_FOLDER = "${PWD}\logs\docker",
[string]$AEM_SCHEME = "http",
[string]$AEM_HOST = "localhost",
[string]$AEM_PORT = "4502",
[string]$AEM_USERNAME = "admin",
[string]$AEM_PASSWORD = "admin",
[string]$MVN_COMMAND = "mvn -D""vault.useProxy=false"" -DskipTests -e -U -P installdeploymentpackage clean install -D""aem.port=$AEM_PORT"" -D""aem.host=$AEM_HOST"" -D""aem.username=$AEM_USERNAME"" -D""aem.password=$AEM_PASSWORD"" -D""aem.scheme=$AEM_SCHEME"" "
)
$PARENT_PROJECT_PATH = "."
. ".\scripts\functions.ps1"
printSectionBanner "Deploying Monolith Package:" "warn"
printSectionLine ("$MVN_COMMAND" -replace "$AEM_PASSWORD", "***")
#update host
if ( $TEST_HOST -eq "localhost" )
{
debug "Test host is set as localhost, updating to use local ip" "info"
$script:TEST_HOST="${LOCAL_IP}"
}
$script:AEM_AVAILABLE=$(testServer "${AEM_SCHEME}://${AEM_HOST}:${AEM_PORT}")
printSectionLine "Is AEM at ${AEM_SCHEME}://${AEM_HOST}:${AEM_PORT} available? ${AEM_AVAILABLE}"
if ( $AEM_AVAILABLE )
{
printSectionLine "AEM host is available!" "info"
printSectionLine "Deploying:" "info"
Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILE}"
} else {
printSectionLine "AEM is not currently available!" "error"
exit 1
}