View concurrent workspaces in Jenkins View concurrent workspaces in Jenkins jenkins jenkins

View concurrent workspaces in Jenkins


I didn't find any available plugin for this, but you can use subfolders in the job's workspace.

  1. Setup a single custom workspace for each build:

enter image description here

  1. Use "Execute Windows batch command" build step with the following content:

    1. Create %BUILD_NUMBER% folder under %WORKSPACE% directory
    2. Copy your project files to %BUILD_NUMBER% directory
    3. Go to %BUILD_NUMBER% directory
    4. Build your project with ant:

      %ANT_HOME%/bin/ant {ant_target_list}
  2. Explore result for each build in job's workspace:

enter image description here

Note:

  • concurrent builds are still safe as they are executed in different folders
  • you will need to cleanup your workspace periodically


I added a post-build action in my Jenkins job "jenkinsJob". This action copies the workspace of the job to the parent caller job.

# Store all the children workspace files in the parent job's workspacemkdir /srv/jenkins/workspace/parentJenkinsJob/${BUILD_NUMBER}cp -ar * /srv/jenkins/workspace/parentJenkinsJob/${BUILD_NUMBER}

This way multiple workspace folders are created under the parent job, and are accessible from the Jenkins webpage.


You can simply add an execute batch command step at the end and make a separate directory and copy the files of the current build into it. You can use a naming convention like Workspace_Build_BuldNumber, so that all workspaces will have a unique number.