Integrating Jenkins with GitHub for Windows
- Download the latest Jenkins “.zip” file from the link: http://mirrors.jenkins-ci.org/windows
2. Extract the Jenkins file and download the “setup.exe” file.
3. Double-click the setup.exe file to open the Jenkins setup wizard.
4. Click the ‘Next’ button and set the Jenkins path.
5. Click the ‘Next’ button, and you will be redirected to the Jenkins setup window. Click the ‘Install’ button to start the Jenkins installation.
6. Once the installation is complete, click the ‘Next’ button.
7. Finally, click the ‘Finish’ button to exit the setup wizard.
8. You will notice that the http://localhost:8080/ URL gets invoked automatically. Wait until the Jenkins is ready to work.
9. Jenkins dashboard gets opened.
Create New Job in Jenkins
1. Open the following URL: http://localhost:8080/
2. Create a new job by clicking the ‘New Job ’ link displayed in the left panel.
3. Enter the new job name in the ‘item name’ field and click the ‘Freestyle project’ radio button. Click the ‘OK’ button.
4. The page gets redirected to a new job form.
5. Enter the project name and description. However, you will notice that the Git is not getting displayed in the source code management.
6. For the Git repository, you need to add the ‘Git ’plugin. Install the Git plugin from the following URL: http://updates.jenkins-ci.org/download/plugins/git/ and place it in C:\Jenkins\plugins. Alternatively, you can also click the ‘Mange Jenkins’ link on the Home page. The page gets redirected to the ‘Manage Jenkins’ page.
7. Click the ‘Manage Plugin’ option on the Manage Jenkins page.
8. Click the ‘Avaliable’ tab and search the Github plugin.
9. Click the Radio button displayed in the Git Plugin and then click ‘Install’ with the restart button.
10. Check whether the Git plugin is installed or not by clicking the ‘Installed’ tab on the Manage Plugin page.
11. Create the new job to see if Git is getting displayed under the source code management.
12. Select the Github path in the Repository URL.
13. Click the ‘Save’ button. You will see an error in the Repository URL.
14. To solve this, provide the Git.exe path in Jenkins setting . Click on ‘Manage Jenkins’ on the Jenkins home page. Click on ‘Configure system link’.
15. The error gets removed from the already created job. Click the job ‘Homes’ and again click the ‘Configuration’ option in the left panel of the project’s home page.
16. Now, give the path to build command and click on job configuration. Then, click the ‘Build’ option and select the ‘Execute Windows batch command’ option from the drop down list. You will see that the text field starts to display. Then, enter the following command: cd C:\Jenkins\workspace\Homescucumber -p firefox –tags @filter
17. Click the ‘Save’ button.
18. Open the Jenkins interface.
19. Click on the newly create job under the Job column on the Jenkins home page.
20. Click the “Build now” link in the left panel to run the script.
Run Parallel Script on Multiple Browsers
- You can run parallel script on multiple browsers, like Chrome, Firefox, etc. Using Jenkins, you can create a new job and add a new build path with different browser name, like‘cd C:\Jenkins\workspace\Homescucumber -p firefox –tags @filter’.
2. Click the ‘Build now’ link in the left panel to run the script.
3. Similarly, you can run two jobs simultaneously or in parallel.