Skip to content

Commit

Permalink
Update workspace when running in windows containers
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed Aug 22, 2024
1 parent 9ebab10 commit c073b6c
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 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,33 @@ 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/'
if (env.CYGWIN_WORKSPACE) {
workspace = env.CYGWIN_WORKSPACE
}
context.echo("Switched to using 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 +2162,7 @@ class Build {
if (env.CYGWIN_WORKSPACE) {
workspace = env.CYGWIN_WORKSPACE
}
context.echo("changing ${workspace}")
context.echo("Switching to using workspace path ${workspace}")
context.ws(workspace) {
buildScripts(
cleanWorkspace,
Expand Down

0 comments on commit c073b6c

Please sign in to comment.