Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 9bf9def

Browse files
StefanSchererthaJeztah
authored andcommitted
Zap a fixed folder, add build number to folder inside
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com> (cherry picked from commit 48662075434da5a13b1316df1ac7488a81e4cf0a) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 168e23a2f542b603b0c21cb8a70f758c0cea074e Component: engine
1 parent 5c084b5 commit 9bf9def

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

components/engine/Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ pipeline {
743743
SOURCES_DRIVE = 'd'
744744
SOURCES_SUBDIR = 'gopath'
745745
TESTRUN_DRIVE = 'd'
746-
TESTRUN_SUBDIR = "CI-$BUILD_NUMBER"
746+
TESTRUN_SUBDIR = "CI"
747747
WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
748748
WINDOWS_BASE_IMAGE_TAG = 'ltsc2016'
749749
}
@@ -804,7 +804,7 @@ pipeline {
804804
SOURCES_DRIVE = 'd'
805805
SOURCES_SUBDIR = 'gopath'
806806
TESTRUN_DRIVE = 'd'
807-
TESTRUN_SUBDIR = "CI-$BUILD_NUMBER"
807+
TESTRUN_SUBDIR = "CI"
808808
WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
809809
WINDOWS_BASE_IMAGE_TAG = 'ltsc2019'
810810
}

components/engine/hack/ci/windows.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ Write-Host -ForegroundColor Red "-----------------------------------------------
5151
# TESTRUN_DRIVE\TESTRUN_SUBDIR\CI-<CommitID> or
5252
# d:\CI\CI-<CommitID>
5353
#
54+
# Optional environment variables help in CI:
55+
#
56+
# BUILD_NUMBER + BRANCH_NAME are optional variables to be added to the directory below TESTRUN_SUBDIR
57+
# to have individual folder per CI build. If some files couldn't be
58+
# cleaned up and we want to re-run the build in CI.
59+
# Hence, the daemon under test is run under
60+
# TESTRUN_DRIVE\TESTRUN_SUBDIR\PR-<PR-Number>\<BuildNumber> or
61+
# d:\CI\PR-<PR-Number>\<BuildNumber>
62+
#
5463
# In addition, the following variables can control the run configuration:
5564
#
5665
# DOCKER_DUT_DEBUG if defined starts the daemon under test in debug mode.
@@ -428,7 +437,12 @@ Try {
428437

429438
# Redirect to a temporary location.
430439
$TEMPORIG=$env:TEMP
431-
$env:TEMP="$env:TESTRUN_DRIVE`:\$env:TESTRUN_SUBDIR\CI-$COMMITHASH"
440+
if ($null -eq $env:BUILD_NUMBER) {
441+
$env:TEMP="$env:TESTRUN_DRIVE`:\$env:TESTRUN_SUBDIR\CI-$COMMITHASH"
442+
} else {
443+
# individual temporary location per CI build that better matches the BUILD_URL
444+
$env:TEMP="$env:TESTRUN_DRIVE`:\$env:TESTRUN_SUBDIR\$env:BRANCH_NAME\$env:BUILD_NUMBER"
445+
}
432446
$env:LOCALAPPDATA="$env:TEMP\localappdata"
433447
$errorActionPreference='Stop'
434448
New-Item -ItemType Directory "$env:TEMP" -ErrorAction SilentlyContinue | Out-Null

0 commit comments

Comments
 (0)