Skip to content

Commit

Permalink
add custom workspace env var (#1647)
Browse files Browse the repository at this point in the history
* add custom workspace env var

* fix lint fails

* change

* changes
  • Loading branch information
gdams authored Apr 2, 2020
1 parent 6ce704f commit 820ec46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,6 @@ class Build {

def enableTests = Boolean.valueOf(buildConfig.ENABLE_TESTS)
def cleanWorkspace = Boolean.valueOf(buildConfig.CLEAN_WORKSPACE)
def jobNameSplit = env.JOB_NAME.split('/')
def jobName = jobNameSplit[jobNameSplit.size() -1]

context.stage("queue") {
def NodeHelper = context.library(identifier: 'openjdk-jenkins-helper@master').NodeHelper
Expand All @@ -492,8 +490,12 @@ class Build {
// This is to avoid windows path length issues.
context.echo("checking ${buildConfig.TARGET_OS}")
if (buildConfig.TARGET_OS == "windows") {
context.echo("changing workspace to C:/cygwin64/tmp/openjdk-build/${jobName}")
context.ws("C:/cygwin64/tmp/openjdk-build/${jobName}") {
def workspace = "C:/cygwin64/tmp/openjdk-build/"
if (env.CYGWIN_WORKSPACE) {
workspace = env.CYGWIN_WORKSPACE
}
context.echo("changing ${workspace}")
context.ws(workspace) {
buildScripts(cleanWorkspace, filename)
}
} else {
Expand Down
1 change: 1 addition & 0 deletions pipelines/src/main/groovy/testDoubles/EnvStub.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ class EnvStub {

String JOB_NAME
String BUILD_NUMBER
String CYGWIN_WORKSPACE
}

0 comments on commit 820ec46

Please sign in to comment.