Integrating Jenkins with GitHub for Windows

Jenkins Installation 

  1.  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.

image001

4. Click the ‘Next’ button and set the Jenkins path.

image002

5. Click the ‘Next’ button, and you will be redirected to the Jenkins setup window. Click the ‘Install’ button to start the Jenkins installation.

image003

6. Once the installation is complete, click the ‘Next’ button.

image004

7. Finally, click the ‘Finish’ button to exit the setup wizard.

image005

8. You will notice that the http://localhost:8080/ URL gets invoked automatically. Wait until the Jenkins is ready to work.

image006

9. Jenkins dashboard gets opened.

image007

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.

image008

3. Enter the new job name in the ‘item name’ field and click the ‘Freestyle project’ radio button. Click the ‘OK’ button.

image009

4. The page gets redirected to a new job form.

image010

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.

image011

8. Click the ‘Avaliable’ tab and search the Github plugin.

image012

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.

image013

11. Create the new job to see if Git is getting displayed under the source code management.

image014

12. Select the Github path in the Repository URL.

image015

13. Click the ‘Save’ button. You will see an error in the Repository URL.

image016

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’.

image017

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.

image018

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

image019

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.

image020

Run Parallel Script on Multiple Browsers

  1. 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.

SHARE THIS

Get A Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.