Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View concurrent workspaces in Jenkins

I am running multiple instances of the same job concurrently, and it creates multiple workspaces. However, I am only able to "view" one workspace from the Jenkins web interface.

Example: Let's say the job name is jenkinsJob. Running it concurrently creates workspaces "jenkinsJob", "jenkinsJob@2" and so on. Jenkins web interface only shows "jenkinsJob" workspace at the job level only. Morever, "jenkinsJob" workspace shows only the files of the instance that completed last. So, if "jenkinsJob@2" completed last in the concurrent execution, the "jenkinsJob" will show the files for "jenkinsJob@2".

Could someone tell me how I can "view" all the concurrent workspaces on the Jenkins interface?

like image 775
techjourneyman Avatar asked Jul 02 '15 16:07

techjourneyman


1 Answers

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
like image 103
Vitalii Elenhaupt Avatar answered Sep 28 '22 14:09

Vitalii Elenhaupt