-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
25 lines (17 loc) · 957 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Param(
[string]$LOG_PATH = "${PWD}\logs",
[string]$LOG_PEFIX = "docker",
[string]$LOG_SUFFIX = ".log",
[string]$TAG = "jdk11",
[string]$FILE = "Dockerfile",
[string]$FUNCTIONS_URI = "https://github.com/aem-design/aemdesign-docker/releases/latest/download/functions.ps1",
[string]$COMMAND = "docker buildx build . -f .\${FILE} -t ${TAG}",
[string]$TEST = "docker run --rm -it -e CI=true -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive:latest ${TAG}"
)
$SKIP_CONFIG = $true
$PARENT_PROJECT_PATH = "."
. ([Scriptblock]::Create((([System.Text.Encoding]::ASCII).getString((Invoke-WebRequest -Uri "${FUNCTIONS_URI}").Content))))
printSectionBanner "Building Image"
printSectionLine ( $COMMAND -replace $env:JDK_DRIVEID, $( "*" * $env:JDK_DRIVEID.length ) ) "warn"
Invoke-Expression -Command "$COMMAND" | Tee-Object -Append -FilePath "${LOG_FILE}"
Invoke-Expression -Command "$TEST" | Tee-Object -Append -FilePath "${LOG_FILE}"