Thursday, February 22, 2018

How to Setup Jenkins Project and specify Windows Node to execute builds.

Jenkins Job:
In the Jenkins Master and Slave environment we can select the specific node to execute build.
in some cases we may required windows platform to run build. 

In my previous blog- I have explained how to setup Windows Node as Slave, Let's setup basic job to execute on Windows platform.


Prerequisites-

  • Jenkins Windows node. 
  • In my case i am using Linux as Master and Windows as Slave. As in picture below.

Step 1- Setup Job and assign Windows node to execute build.

  • Login to Jenkins as Admin > New Item > Enter Item name(Win_Powershell) > Type Freestyle >OK

  • On the next screen select Restrict where this project can be run
  • In the Label Expression> Windows Node name.

  • In the Build steps > add > execute Windows batch command > in box type command to execute 
  • %SystemRoot%\system32\windowspowershell\v1.0\powershell.exe get-date > C:\Jenkinstest.txt
  • Apply and Save.

Step 2- Run the build and check output at Windows Node.
  • After setting up Project, let's run first Build.
  • Select Build Now

  • Check build logs
  • Build history > select Build Number > Console Output










  • After success full build you Job output will be like this.

Basic Jenkins Job configured successfully with Windows Slave node. You can customized job script as per your requirement.


1 comment: