Deprecated: Function create_function() is deprecated in /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php on line 258

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372

Warning: Cannot modify header information - headers already sent by (output started at /home/qualit96/public_html/wp-content/plugins/revslider/includes/framework/functions-wordpress.class.php:258) in /home/qualit96/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1372
{"id":13767,"date":"2018-03-07T21:38:21","date_gmt":"2018-03-07T16:38:21","guid":{"rendered":"http:\/\/quality-spectrum.com\/?p=13767"},"modified":"2019-11-20T21:05:11","modified_gmt":"2019-11-20T16:05:11","slug":"jenkins-installation-background","status":"publish","type":"post","link":"https:\/\/quality-spectrum.com\/jenkins-installation-background\/","title":{"rendered":"Jenkins \u2013 Installation Background"},"content":{"rendered":"

In the previous article<\/strong> <\/a>a brief history, main features and a very basic control flow was discussed. Moving on I\u2019d like to go over some important points while installing Jenkins and running it the first time. There are quite a few tutorials showing this part, I feel some lack some introduction to new terms which is what this article is all about. Also, most tutorials start directly with the technical details. I\u2019ve always been more comfortable knowing the \u2018what\u2019 and \u2018why\u2019 before going into the \u2018how\u2019. Keeping that tradition, let me go over \u2018what\u2019 and \u2018why\u2019 first.<\/p>\n

Pre-Requisites \u2013 Java and Chocolately<\/h3>\n

Jenkins is written in Java and therefore requires the \u2018JDK\u2019 (Java Development Kit) including the compiler and executor. A lot of tools out there which help to install java, the one I like to use most is Chocolately. They describe it as \u2018the package manager for windows\u2019. Essentially it makes installation a lot easier for different packages (software \/ libraries). Once you get the hang of it (which is very simple), saves a lot of grief and time.<\/p>\n

For installing Java you can go to it\u2019s website, download and execute the files, and then add the system variables. Or you can install Chocolately and reduce a few steps. For chocolately installation, you don\u2019t download a file. Instead you just run a batch command and chocolately installs itself! The installation<\/strong> <\/a>page has all the details. Open the command prompt in administrative mode, run the command<\/strong> <\/a>and you\u2019re all set.<\/p>\n

Now installing Java is a piece of cake. Guess what you have to do? Just run a command in cmd again. You can type \u2018Java\u2019 in the search to see all the variants, we would run the command:<\/p>\n<\/div>choco install jdk8

\u2018choco\u2019 making it a chocolately command, \u2018install jdk8\u2019 asking to install the JDK package version 8. How easy was that! The best part is, any other future installations are going to be as easy. For instance, installation maven, Angular, Node JS etc are all just one batch command away.<\/p>\n

Installation methods<\/h3>\n

If you go to the Jenkins website<\/strong>\u2019s <\/a>download page you\u2019ll see many different installation types. Jenkins can be run on a lot of platforms including docker. For Windows users, there are two main options, 1) using the windows installer or 2) get the \u2018WAR\u2019 file.<\/p>\n

The \u2018WAR\u2019 file is Java\u2019s \u2018Web Application Resource\u2019 file which includes a collection of different Java files including JARs, JSPs, XML files, web pages and other resources. Jenkins works pretty much the same with both files operation wise as far as my experience, however the method of running them and portability is slightly different.<\/p>\n

With windows setup files, run the installer and follow along the wizard, that\u2019s all there is as far as installation goes.<\/p>\n

Using command prompt<\/h3>\n

When I started learning new technologies, I noticed more savvy users were using command prompt versions of most applications. At first felt kind of difficult and less intuitive. However, with time realized once you get the hang of it, things get quite easy and fast. With Jenkins there isn\u2019t much of a difference except how you start the application, however using this way makes things a lot easier.<\/p>\n

To run the WAR file, download the file and open the command prompt. CD into the directory where the file is placed and type<\/p>\n<\/div>Java -jar jenkins.war\n\n

That\u2019s it, Jenkins would initialize itself and start running, that\u2019s all as far as \u2018installation\u2019 goes. If you are wondering, your right Jenkins does not need to be \u2018installed\u2019 here, it runs as an executable. To close the Jenkins server, press \u2018CTRL+C\u2019 on the command prompt running Jenkins and the server will close. To restart run the same command for the WAR file as before<\/p>\n

Local server<\/h3>\n

Jenkins deploys a local server which is accessed through \u2018localhost:8080\u2019. A local host \u2018server\u2019 is used to \u2018serve\u2019 web pages \/ an application when requested by a client, pretty much the same way as web server does. The only difference for the client being the way we access it. A web server will require to enter a \u2018URL\u2019 which translates to an IP for a server machine. For our local host, there is no IP needed and it\u2019s just \u2018localhost\u2019, and 8080 being the port for accessing.<\/p>\n

Back in the day installing a local host server was not a behind the scene process and used to take a while, with layers of abstraction and advancement in development environments, this is now something that gets done behind the scene without the user knowing what all this entails.<\/p>\n

Initial Setup<\/h3>\n

From here on, things are quite straight forward. One first creates an admin user which first requires entering a secure password to access the console. To obtain the password, follow the instructions on the page (In this case, copy the password from the given file):<\/p>\n<\/div><\/span>

Jenkins 2.0 installs quite a few plugins as part of the default installation. They are very helpful, like some highlighted below.<\/p>\n<\/div><\/span>

Jenkins uses XML files for configuration. By default these files are placed at C:\\Users\\<logged in user>\\.jenkins\\ and can be viewed (and edited) to see and update Jenkins configurations.<\/p>\n

Basic Security<\/h3>\n

Jenkins deployed on a local \u2018server\u2019 means the application can be accessed anywhere on the network, which leads to the need for \u2018security\u2019.<\/p>\n

You can have a lot of users for logging in to Jenkins with different privileges (and even access without logging in). Once the plugins are installed, the first Admin User creation dialog appears. Pretty straight forward.<\/p>\n<\/div><\/span>

That\u2019s not all for security. Jenkins has a Global security configuration setting also. Here are a few recommended settings to do here:<\/p>\n<\/div><\/span>

Read only access<\/h3>\n

For teams triggering automated tests through Jenkins this is a very powerful feature. You would want a wide access to the reports from your automated runs, which gets a lot easier with this feature. If checked as shown below, anyone on the network can access the localhost server and \u2018view\u2019 all jobs and test results, which in my opinion is the way it should be.<\/p>\n<\/div><\/span>

If you would like to have intermediate user accounts (between the admin and read only users), you can add \/ manage user accounts here:<\/p>\n<\/div><\/span>

Docker friendly<\/h3>\n

Before I end this, I must mention Jenkins does run on docker too. That means you can have multiple Jenkins versions running. Or you can have one version but multiple backups of it which takes your environment management to a whole new level.<\/p>\n

 <\/p>\n

We talked about pre-requisites of Jenkins, ways to install and run it, using the command prompt, plugins installation and default security. This guide might not server well as a stand-alone piece, however would be great reference material while going through the process.<\/p>\n<\/div>

<\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":13774,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[45],"tags":[],"yoast_head":"\nJenkins \u2013 Installation Background - Quality Spectrum<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jenkins \u2013 Installation Background - Quality Spectrum\" \/>\n<meta property=\"og:url\" content=\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/\" \/>\n<meta property=\"og:site_name\" content=\"Quality Spectrum\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-07T16:38:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-20T16:05:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/quality-spectrum.com\/wp-content\/uploads\/2018\/03\/Jenkins-installation-background.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@aali_khalid\" \/>\n<meta name=\"twitter:site\" content=\"@aali_khalid\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/quality-spectrum.com\/#organization\",\"name\":\"Quality Spectrum\",\"url\":\"https:\/\/quality-spectrum.com\/\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/alikhalid\/\",\"https:\/\/www.youtube.com\/c\/QualitySpectrum\",\"https:\/\/twitter.com\/aali_khalid\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/quality-spectrum.com\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/quality-spectrum.com\/wp-content\/uploads\/2019\/11\/QS-logo-mobile-e1574510459832.png\",\"width\":40,\"height\":40,\"caption\":\"Quality Spectrum\"},\"image\":{\"@id\":\"https:\/\/quality-spectrum.com\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/quality-spectrum.com\/#website\",\"url\":\"https:\/\/quality-spectrum.com\/\",\"name\":\"Quality Spectrum\",\"description\":\"Redefining software quality\",\"publisher\":{\"@id\":\"https:\/\/quality-spectrum.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/quality-spectrum.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/quality-spectrum.com\/wp-content\/uploads\/2018\/03\/Jenkins-installation-background.png\",\"width\":1920,\"height\":1080},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#webpage\",\"url\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/\",\"name\":\"Jenkins \\u2013 Installation Background - Quality Spectrum\",\"isPartOf\":{\"@id\":\"https:\/\/quality-spectrum.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#primaryimage\"},\"datePublished\":\"2018-03-07T16:38:21+00:00\",\"dateModified\":\"2019-11-20T16:05:11+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/\"]}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#webpage\"},\"author\":{\"@id\":\"https:\/\/quality-spectrum.com\/#\/schema\/person\/4805a00d7139e111ea9430e17cc8f28c\"},\"headline\":\"Jenkins \\u2013 Installation Background\",\"datePublished\":\"2018-03-07T16:38:21+00:00\",\"dateModified\":\"2019-11-20T16:05:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#webpage\"},\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/quality-spectrum.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#primaryimage\"},\"articleSection\":\"CI \/ CD \/ DevOps\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/quality-spectrum.com\/jenkins-installation-background\/#respond\"]}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/quality-spectrum.com\/#\/schema\/person\/4805a00d7139e111ea9430e17cc8f28c\",\"name\":\"Ali Khalid\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/quality-spectrum.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70cbf539f218f275a77959dd2e56bddb?s=96&d=mm&r=g\",\"caption\":\"Ali Khalid\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/posts\/13767"}],"collection":[{"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/comments?post=13767"}],"version-history":[{"count":3,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/posts\/13767\/revisions"}],"predecessor-version":[{"id":13797,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/posts\/13767\/revisions\/13797"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/media\/13774"}],"wp:attachment":[{"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/media?parent=13767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/categories?post=13767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quality-spectrum.com\/wp-json\/wp\/v2\/tags?post=13767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}