Skip to content

Commit 5c83293

Browse files
committed
fix debug script.
1 parent 4338237 commit 5c83293

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

debug.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ Param(
55
[string]$TAG = "jdk17",
66
[string]$FILE = "Dockerfile",
77
[string]$FUNCTIONS_URI = "https://github.com/aem-design/aemdesign-docker/releases/latest/download/functions.ps1",
8-
[string]$COMMAND = "docker build . -f .\${FILE} -t ${TAG}"
8+
[string]$COMMAND = "docker build . -f .\${FILE} -t "
99
)
1010

11+
$IMAGENAME=Select-String -path $FILE '.*imagename="(.*)".*' -AllMatches | Foreach-Object {$_.Matches} | Foreach-Object {$_.Groups[1].Value}
12+
$IMAGEVERSION=Select-String -path $FILE '.*version="(.*)".*' -AllMatches | Foreach-Object {$_.Matches} | Foreach-Object {$_.Groups[1].Value}
13+
14+
$COMMAND="$COMMAND${IMAGENAME}:${IMAGEVERSION}"
15+
1116
$SKIP_CONFIG = $true
1217
$PARENT_PROJECT_PATH = "."
1318

@@ -16,6 +21,9 @@ $PARENT_PROJECT_PATH = "."
1621
printSectionBanner "Loading Debug Image"
1722
printSectionLine "$COMMAND" "warn"
1823

19-
$IMAGENAME=Select-String -path $FILE '.*imagename="(.*)".*' -AllMatches | Foreach-Object {$_.Matches} | Foreach-Object {$_.Groups[1].Value}
24+
# Run $COMMAND and capture output to log file
25+
Invoke-Expression -Command "$COMMAND" | Tee-Object -Append -FilePath "${LOG_FILE}"
26+
2027

21-
docker run -it --rm -v ${PWD}:/build/source:rw aemdesign/java-buildpack bash --login
28+
docker run -it --rm -v ${PWD}:/build/source:rw ${IMAGENAME}:${IMAGEVERSION} bash --login
29+
# docker run -it --rm -v ${PWD}:/build/source:rw aemdesign/${IMAGENAME}:${IMAGEVERSION} bash --login

0 commit comments

Comments
 (0)