{"id":76,"date":"2011-12-26T17:25:35","date_gmt":"2011-12-26T16:25:35","guid":{"rendered":"http:\/\/dev.qualilogy.com\/en\/?p=76"},"modified":"2013-01-04T17:26:46","modified_gmt":"2013-01-04T16:26:46","slug":"jenkins-installation","status":"publish","type":"post","link":"http:\/\/qualilogy.com\/en\/jenkins-installation\/","title":{"rendered":"Jenkins &#8211; Installation"},"content":{"rendered":"<p>The objective of this post is to present the installation of Jenkins. It will be the opportunity to detail the resolution of some problems specific to our environment. <!--more--><\/p>\n<h3><span style=\"text-decoration: underline\">Installation of Jenkins<\/span><\/h3>\n<p>There are several manners to install Jenkins. According to our environment, we chose to download from the Jenkins web site a file <strong>jenkins.war<\/strong>.<\/p>\n<p>As for the installation of Sonar, we just have to copy this file under <strong>C:\\Program Files ( x86 ) \\Apache Software Foundation\\Tomcat 7.0\\webapps<\/strong>, (re-)start Tomcat, then to start Jenkins from its url and&#8230;<\/p>\n<p>Nothing. My browser runs, runs, runs&#8230;  I stop and restart Tomcat again, nothing works. Even Sonar that was previously available will no longer start.<\/p>\n<p>Looking in the directory <strong>..\\Apache Software Foundation\\Tomcat 7.0\\ logs<\/strong>, we notice a file tomcat7-stderr.xx.log (xx is the current date) and if you open it, one (or more) message(s) <strong>java.lang.OutOfMemoryError: PermGen space<\/strong>.<\/p>\n<p>We need to update our Tomcat configuration, as follows:<\/p>\n<ul>\n<li>Start Tomcat7w.exe.<\/li>\n<li>In the tab Java, enter the following option <strong>-XX:MaxPermSize=256m<\/strong>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-529\" title=\"Tomcat_Properties2\" src=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Tomcat_Properties2.jpg\" alt=\"\" width=\"417\" height=\"397\" \/><br \/>\n<a href=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Jenkins_Menu.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-531\" title=\"Jenkins_Menu\" src=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Jenkins_Menu.jpg\" alt=\"\" width=\"187\" height=\"172\" \/><\/a>We can now relaunch Tomcat and enter into Jenkins. Notice my interface in Spanish: the language is automatically parametrized according to the corresponding variable of the browser.<\/p>\n<p>Well, first thing now is to have a look on the configuration of Jenkins, by clicking the administration menu (&#8216;Administrar Jenkins&#8217; in my case).<\/p>\n<h3><span style=\"text-decoration: underline\">Jenkins Configuration<br \/>\n<\/span><\/h3>\n<p>In the administration page, a message warns us that our Tomcat is not UTF-8 compatible. No need to go into details, a link <a title=\"Jenkins i18n\" href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Tomcat#Tomcat-i18n\" target=\"_blank\"><strong>Tomcat i18n<\/strong><\/a> open an help page on the Jenkins web site, where we can discover how to solve this problem:<\/p>\n<ul>\n<li>In the folder <strong>..\\Apache Software Foundation\\Tomcat 7.0\\conf<\/strong>, look for the file <strong>server.xml<\/strong>.<\/li>\n<\/ul>\n<ul>\n<li>In this file, look for the section <strong>Connector<\/strong> and insert the following attribute: <strong>URIEncoding=&#8221;UTF-8&#8243;<\/strong>. This is how it looks in my file:<a href=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Tomcat_Connector.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-534\" title=\"Tomcat_Connector\" src=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Tomcat_Connector.jpg\" alt=\"\" width=\"369\" height=\"72\" \/><\/a><\/li>\n<\/ul>\n<p>Stop\/Start the service Tomcat and back in the administration page of Jenkins, the warning message has gone.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Jenkins_Conf1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-544\" title=\"Jenkins_Conf1\" src=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Jenkins_Conf1.jpg\" alt=\"\" width=\"311\" height=\"54\" \/><\/a>Let&#8217;s go to see now the parameters of configuration: the first thing which we notice is that Jenkins is installed in a directory C:\\.jenkins. Oops, it is not exactly what I wish. I prefer to centralize my environment of analysis on a dedicated hard disk. Let&#8217;s see how to change the location of the Jenkins &#8216;repository&#8217;.<\/p>\n<p>We need to specify a variable <strong>JENKINS_HOME<\/strong>. Two way to proceed for an installation such as ours. The first one is incorrect, but I indicate it nevertheless because this information is not easy to find:<\/p>\n<ul>\n<li>In the folder <strong>\\Apache Software Foundation\\Tomcat 7.0\\webapps\\jenkins\\WEB-INF<\/strong>, find the <strong>web.xml<\/strong> file which is the entry point of our webapp Jenkins.<\/li>\n<li>In this file, insert the following section in order to declare the variable <strong>JENKINS_HOME<\/strong> on a directory F:\\Jenkins.<a href=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Jenkins_Conf2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-546\" title=\"Jenkins_Conf2\" src=\"http:\/\/qualilogy.com\/wp-content\/uploads\/2011\/12\/Jenkins_Conf2.jpg\" alt=\"\" width=\"433\" height=\"92\" \/><\/a>Well, avoid it completely as this is malpractice: this file and thus our modification will be overwritten in case we install a new jenkins.war, when we want to upgrade for example. So unless you want make this change with each new installation, it is better to proceed as this:<\/li>\n<\/ul>\n<ul>\n<li>In the folder <strong>\\Apache Software Foundation\\Tomcat 7.0\\webapps\\jenkins\\WEB-INF<\/strong>, find the file <strong>context.xml<\/strong> and insert the following line:<\/li>\n<\/ul>\n<p style=\"text-align: left;padding-left: 60px\"><strong>&lt;Environment name=&#8221;JENKINS_HOME&#8221; value=&#8221;C:\/SRC\/Jenkins\/&#8221; type=&#8221;java.lang.String&#8221;\/&gt;<\/strong><\/p>\n<p style=\"text-align: left\">This time, we declare our &#8216;repository&#8217; on C:\\SRC\\Jenkins, directly at the level of Tomcat and not anymore within the webapp Jenkins.<\/p>\n<p>It is recommended to choose well this location before installing the plugin Sonar or starting to work with Jenkins. Indeed, if you change the &#8216;home&#8217; of Jenkins, a new environment will be created and you will lose your existing configuration (except if you move your current repository to the new location).<\/p>\n<p>The <a title=\"Jenkins - Sonar plugin\" href=\"http:\/\/qualilogy.com\/en\/sonar-jenkins-plugin\">next post<\/a> will be about the installation of the Sonar plugin for Jenkins.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The objective of this post is to present the installation of Jenkins. It will be the opportunity to detail the resolution of some problems specific to our environment.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-sonar-installation"],"_links":{"self":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/76"}],"collection":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":1,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":77,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/76\/revisions\/77"}],"wp:attachment":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}