Monday, September 2, 2019

Jenkins : How to install Jenkins Server on Windows Machine for Automation


Jenkins : How to install Jenkins Server on Windows Machine for Automation


Jenkins tools now used widely in DevOps, Continuous Integration(CI) & Continues Development(CD).

What is Jenkins?

Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.

Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.

Instead of building your application manually you can use Jenkins and schedule your build job whenever you want. With respect to Automation, most of the time we run our automation scripts manually. Sometimes we need to manually run your scripts in the night also, if you use Jenkins and schedule your job in the night, it automatically runs your scripts.              

In the DevOps world, Development and Operations are not separate role. The industry expectations are high now, any developer or tester, operations team should now build deployment tools and at least they should have basic knowledge of how to configure new jobs and run the jobs.

One of the key advantages of Jenkins tool is that it requires little maintenance and has built-in GUI tool for easy updates. Jenkins also provides customized solution as there are over 400 plugins to support building and testing virtually any project. Basically, Jenkins integrates development life-cycle processes of all kinds, including build, document, test, package, stage, deploy, static analysis and much more.

How Jenkins Server is used and works in Application development cycle:

For example a scenario where the complete source code of the application was built and then deployed on a test server for testing, it follows the below steps

  • Developer commits the code to the source code repository like git.
  • The Jenkins server checks the repository (like git) at regular intervals for changes.
  • Soon once developer commits the codes, the Jenkins server detects the changes that have occurred in the source code repository.
  • Jenkins will pull those changes and will start preparing a new build.
  • If the build fails, then the respective team will be notified.
  • If the build is successful, then Jenkins deploys the build in the test server.
  • You could configure the pipeline (the script to run) to create the build with several steps:
  • Prepare, test (unit and integration tests), package, publish, deploy.
  • After running it, Jenkins generates a feedback, if these constraints are ok, the artifact is valid. And then Jenkins notifies the developers about the build and test results.
  • Jenkins will continue to check the source code repository for further changes made in the source code, and the whole process will keep on repeating.


Let’s see how to install Jenkins Server on Windows:


Pre-requisites for installing Jenkins on windows:

Java should be installed on your machine. follow this post for installing java and setting java path "How to Install Java & set Java Path"

Follow the below steps to install Jenkins on Windows machine:

1. Open Jenkins download page : https://jenkins.io/download/

2. In the “Download Jenkins XXX version for:” section select windows (based on your machine platform you can select the right option, I’m selecting windows here)



3. It automatically starts downloading the Jenkins & wait download completes.




4.  The downloaded Jenkins file will be in zip, extract it and navigate to extracted folder. Then it looks like below & Double click on the jenkins exe file:




5. Click on “Next” button in the Jenkins Setup wizard as shown in the below screenshot:



6. Choose the location where you want to install ( go to the default location) and click on “Next” button on select Destination Folder wizard:



7. Click on “Install” button on "Ready to Install Jenkins" wizard:



8. Click on “Finish” button on "Completed the Jenkins Setup" wizard:



9. After completing the Jenkins installation process, a browser tab will pop-up asking for the initial Administrator password. To access Jenkins, you need to go to browse the following path in your web browser.

http://localhost:8080

10. Then open the browser and navigate to localhost:8080




11. The initial Administrator password should be found under the Jenkins installation path

For default installation location to C:\Program Files (x86)\Jenkins, a file called initialAdminPassword can be found under C:\Program Files (x86)\Jenkins\secrets.



12. Open the highlighted file and copy the content of the initialAdminPassword file.

13. Paste the password it into browser's tab (http://localhost:8080/login?form=%2F) and click on Continue button.



14. Click on the "Install suggested plugins button" so Jenkins will retrieve and install the essential plugins.




15. After all suggested plugins were installed, the "Create First Admin User" panel will show up. Fill all the fields with user name, password, email details and hit the "Save and Finish" button.
Please remember the username and password. then jenkins is ready page will open.




16. Login Page looks like this :


17. Need to enter username and password which you set during account setup.

We have successfully installed a new Jenkins Server on windows machine.

Advantages of Jenkins ?



  • Jenkins is open source
  • It is easy to create new Jenkins plugin if one is not available
  • It is a tool which is written in Java. Hence it can be portable to almost all major platforms.
  • It is user-friendly, easy to install and does not require additional installations or components.
  • It is free of cost.
  • Easily Configurable. Jenkins can be easily modified and extended. It deploys code instantly, generates test reports.
  • Jenkins can be configured according to the requirements for continuous integrations and continuous delivery.
  • Platform Independent. Jenkins is available for all platforms and different operating systems, whether OS X, Windows or Linux.
  • Rich Plugin ecosystem. The extensive pool of plugins makes Jenkins flexible and allows building, deploying and automating across various platforms.
  • Easy support. Because it is open source and widely used, there is no shortage of support from large online communities of agile teams.
  • Developers write the tests to detect the errors of their code as soon as possible. So the developers don’t waste time on large-scale error-ridden integrations.
  • Issues are detected and resolved almost right away which keeps the software in a state where it can be released at any time safely.
  • Most of the integration work is automated. Hence fewer integration issues.







No comments:

Post a Comment

If any suggestions or issue, please provide