diff --git a/Tasks/JenkinsQueueJob/jenkinsqueuejobtask.ts b/Tasks/JenkinsQueueJob/jenkinsqueuejobtask.ts index 03879a502a71..f6c606772674 100644 --- a/Tasks/JenkinsQueueJob/jenkinsqueuejobtask.ts +++ b/Tasks/JenkinsQueueJob/jenkinsqueuejobtask.ts @@ -75,7 +75,15 @@ export class TaskOptions { tl.debug('teamPluginUrl=' + this.teamPluginUrl); this.teamBuildPluginAvailable = false; - this.saveResultsTo = path.join(tl.getVariable('Build.StagingDirectory'), 'jenkinsResults'); + // 'Build.StagingDirectory' is available during build. + // It is kept here (different than what is used during release) to maintain + // compatibility with other tasks relying on Jenkins results being placed in this folder. + var resultsDirectory: string = tl.getVariable('Build.StagingDirectory'); + if (!resultsDirectory) { + // 'System.DefaultWorkingDirectory' is available during build and release + resultsDirectory = tl.getVariable('System.DefaultWorkingDirectory'); + } + this.saveResultsTo = path.join(resultsDirectory, 'jenkinsResults'); this.strictSSL = ("true" !== tl.getEndpointDataParameter(this.serverEndpoint, "acceptUntrustedCerts", true)); tl.debug('strictSSL=' + this.strictSSL); diff --git a/Tasks/JenkinsQueueJob/task.json b/Tasks/JenkinsQueueJob/task.json index ff79f05a10c2..9dcb35e51771 100644 --- a/Tasks/JenkinsQueueJob/task.json +++ b/Tasks/JenkinsQueueJob/task.json @@ -14,7 +14,7 @@ "version": { "Major": 1, "Minor": 1, - "Patch": 5 + "Patch": 6 }, "groups": [ { diff --git a/Tasks/JenkinsQueueJob/task.loc.json b/Tasks/JenkinsQueueJob/task.loc.json index 1775cad115bf..cde982ebeb64 100644 --- a/Tasks/JenkinsQueueJob/task.loc.json +++ b/Tasks/JenkinsQueueJob/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 1, "Minor": 1, - "Patch": 5 + "Patch": 6 }, "groups": [ {