Skip to content

Commit

Permalink
Update workspace when running in windows containers (#1101)
Browse files Browse the repository at this point in the history
* Update workspace when running in windows containers

Signed-off-by: Stewart X Addison <[email protected]>

* Update to avoid processing CYGWIN_WORKSPACE

This was copied from the non-docker case but I don't believe it's part of the same logic, so skipping for simplicity

Signed-off-by: Stewart X Addison <[email protected]>

---------

Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa authored Sep 2, 2024
1 parent 9ebab10 commit d33d46f
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2115,14 +2115,30 @@ class Build {
// Add uid and gid userns mapping required for podman
dockerRunArg += " --userns keep-id:uid=1002,gid=1003"
}
context.docker.image(buildConfig.DOCKER_IMAGE).inside(buildConfig.DOCKER_ARGS+" "+dockerRunArg) {
buildScripts(
cleanWorkspace,
cleanWorkspaceAfter,
cleanWorkspaceBuildOutputAfter,
filename,
useAdoptShellScripts
)
if (buildConfig.TARGET_OS == 'windows') {
def workspace = 'C:/workspace/openjdk-build/'
context.echo("Switched to using non-default workspace path ${workspace}")
context.ws(workspace) {
context.docker.image(buildConfig.DOCKER_IMAGE).inside(buildConfig.DOCKER_ARGS+" "+dockerRunArg) {
buildScripts(
cleanWorkspace,
cleanWorkspaceAfter,
cleanWorkspaceBuildOutputAfter,
filename,
useAdoptShellScripts
)
}
}
} else {
context.docker.image(buildConfig.DOCKER_IMAGE).inside(buildConfig.DOCKER_ARGS+" "+dockerRunArg) {
buildScripts(
cleanWorkspace,
cleanWorkspaceAfter,
cleanWorkspaceBuildOutputAfter,
filename,
useAdoptShellScripts
)
}
}
}
}
Expand All @@ -2143,7 +2159,7 @@ class Build {
if (env.CYGWIN_WORKSPACE) {
workspace = env.CYGWIN_WORKSPACE
}
context.echo("changing ${workspace}")
context.echo("Switched to using non-default workspace path ${workspace}")
context.ws(workspace) {
buildScripts(
cleanWorkspace,
Expand Down

0 comments on commit d33d46f

Please sign in to comment.