Online home | GitHub

cpollet.me

back to posts list

Install Jenkins

Published on 18 Sep 2015

After installation of Ubuntu 14.04 LTS, as root (just like every other commands here):

Install Java

Install Maven

Install Jenkins

#### Virtual host file

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName ci.company.com
    ServerAlias ci
    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/ nocanon
    AllowEncodedSlashes NoDecode
</VirtualHost>

Install mysql

Install sonar

Content of /etc/init.d/sonar

#!/bin/sh
/usr/bin/sonar $*

#### Sonar profile in /opt/maven/conf/settings.xml

<profile>
    <id>sonar</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <sonar.jdbc.url>
          jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8
        </sonar.jdbc.url>
        <sonar.jdbc.username>sonar</sonar.jdbc.username>
        <sonar.jdbc.password>sonar</sonar.jdbc.password>

        <!-- Optional URL to server. Default value is http://localhost:9000 -->
        <sonar.host.url>
          http://myserver:9000
        </sonar.host.url>
    </properties>
</profile>

make sure you have jacoco 0.7.5.201505241946 and sonar’s Java plugin >= 3.4 otherwise it wont work. You’ll get something like

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project ...: Unable to read .../target/jacoco.exec: Incompatible version 1007. -> [Help 1]

If you followed all the steps, you should be all set! It’s time to trigger a build

Resources

Last generated on 18 Nov 2016