Skip to content

Commit

Permalink
update helper scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Dec 16, 2020
1 parent ddfbaeb commit 6ed3ede
Show file tree
Hide file tree
Showing 11 changed files with 418 additions and 89 deletions.
45 changes: 45 additions & 0 deletions aemdesign-aem-author/deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 -Dvault.useProxy=false -DskipTests clean install -P autoInstallPackage"

)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Deploying:" "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_FILENAME}"

} else {
printSectionLine "AEM is not currently available!" "error"
exit 1
}

23 changes: 23 additions & 0 deletions aemdesign-aem-author/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 clean package "
)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Creating Package"
printSectionLine ("$MVN_COMMAND" -replace "$AEM_PASSWORD", "***")

Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILENAME}"

45 changes: 45 additions & 0 deletions aemdesign-aem-common/deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 -Dvault.useProxy=false -DskipTests clean install -P autoInstallPackage"

)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Deploying:" "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_FILENAME}"

} else {
printSectionLine "AEM is not currently available!" "error"
exit 1
}

23 changes: 23 additions & 0 deletions aemdesign-aem-common/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 clean package "
)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Creating Package"
printSectionLine ("$MVN_COMMAND" -replace "$AEM_PASSWORD", "***")

Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILENAME}"

45 changes: 45 additions & 0 deletions aemdesign-aem-core-deploy/deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 -Dvault.useProxy=false -DskipTests clean install -P autoInstallPackage"

)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Deploying:" "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_FILENAME}"

} else {
printSectionLine "AEM is not currently available!" "error"
exit 1
}

23 changes: 23 additions & 0 deletions aemdesign-aem-core-deploy/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 clean package "
)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Creating Package"
printSectionLine ("$MVN_COMMAND" -replace "$AEM_PASSWORD", "***")

Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILENAME}"

45 changes: 45 additions & 0 deletions aemdesign-aem-services/deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 -Dvault.useProxy=false -DskipTests clean deploy -P autoInstallBundle -Dmaven.deploy.skip=true -DskipNexusStagingDeployMojo=true"

)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Deploying:" "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_FILENAME}"

} else {
printSectionLine "AEM is not currently available!" "error"
exit 1
}

23 changes: 23 additions & 0 deletions aemdesign-aem-services/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 clean package "
)

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Creating Package"
printSectionLine ("$MVN_COMMAND" -replace "$AEM_PASSWORD", "***")

Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILENAME}"

17 changes: 10 additions & 7 deletions deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,38 @@ Param(
[string]$AEM_HOST = "localhost",
[string]$AEM_PORT = "4502",
[string]$AEM_USERNAME = "admin",
[string]$AEM_PASSWORD = "admin"
[string]$AEM_PASSWORD = "admin",
[string]$MVN_COMMAND = "mvn -Dvault.useProxy=false -DskipTests -e -U -P installdeploymentpackage clean install "

)

$PARENT_PROJECT_PATH = "."

. ".\scripts\functions.ps1"

$global:LOG_PATH = $LOG_PATH
$global:TEST_SELENIUM_URL = $TEST_SELENIUM_URL
$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Deploying Monolith Package:" "warn"
printSectionLine "mvn -Dvault.useProxy=false -DskipTests -e -U -P installdeploymentpackage clean install"
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"
$global:TEST_HOST="${LOCAL_IP}"
$script:TEST_HOST="${LOCAL_IP}"
}

$global:AEM_AVAILABLE=$(testServer "${AEM_SCHEME}://${AEM_HOST}:${AEM_PORT}")
$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 -DskipTests -e -U -P installdeploymentpackage clean install" | Tee-Object -Append -FilePath "${LOG_FILENAME}"
Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILENAME}"

} else {
printSectionLine "AEM is not currently available!" "error"
Expand Down
25 changes: 25 additions & 0 deletions package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "${LOG_PATH}\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 clean package "
)

$PARENT_PROJECT_PATH = "."

. ".\scripts\functions.ps1"

$script:LOG_PATH = $LOG_PATH
$script:TEST_SELENIUM_URL = $TEST_SELENIUM_URL

printSectionBanner "Creating Package"
printSectionLine ("$MVN_COMMAND" -replace "$AEM_PASSWORD", "***")

Invoke-Expression -Command "$MVN_COMMAND" | Tee-Object -Append -FilePath "${LOG_FILENAME}"

Loading

0 comments on commit 6ed3ede

Please sign in to comment.