From 6f85ebd06a75f15e32d9b3a3f7e8c59bb5349b12 Mon Sep 17 00:00:00 2001 From: Andreyev Dias de Melo Date: Fri, 16 Sep 2016 08:58:43 -0300 Subject: [PATCH 1/3] Fixing "variable contains an uppercase letter on line 24" --- manifests/init.pp | 2 +- templates/sonar.properties.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3a96b781..f87596c8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,7 +21,7 @@ $home = undef, $host = undef, $port = 9000, - $portAjp = -1, + $portajp = -1, $download_url = 'https://sonarsource.bintray.com/Distribution/sonarqube', $download_dir = '/usr/local/src', $context_path = '/', diff --git a/templates/sonar.properties.erb b/templates/sonar.properties.erb index c3a0e1df..8c702408 100644 --- a/templates/sonar.properties.erb +++ b/templates/sonar.properties.erb @@ -16,7 +16,7 @@ sonar.web.host: <%= @host %> #sonar.web.host: 0.0.0.0 <% end -%> sonar.web.port: <%= @port %> -sonar.ajp.port: <%= @portAjp %> +sonar.ajp.port: <%= @portajp %> <% if has_variable?('context_path') -%> sonar.web.context: <%= @context_path %> <% end -%> From 3e496b910d37af08d733a822fc04d19c17e31df0 Mon Sep 17 00:00:00 2001 From: Andreyev Dias de Melo Date: Fri, 16 Sep 2016 08:59:03 -0300 Subject: [PATCH 2/3] Fixing "line has more than 140 characters on line 139" --- manifests/init.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index f87596c8..f9988c5f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -136,7 +136,8 @@ -> # ===== Install SonarQube ===== exec { 'untar': - command => "unzip -o ${tmpzip} -d ${installroot} && chown -R ${user}:${group} ${installroot}/${package_name}-${version} && chown -R ${user}:${group} ${real_home}", + command => "unzip -o ${tmpzip} -d ${installroot} && chown -R \ + ${user}:${group} ${installroot}/${package_name}-${version} && chown -R ${user}:${group} ${real_home}", creates => "${installroot}/${package_name}-${version}/bin", notify => Service['sonarqube'], } From 95becdf40241198e98116df326e2486b660e7e8a Mon Sep 17 00:00:00 2001 From: "Trond I. Alseth" Date: Fri, 23 Sep 2016 09:47:02 +0200 Subject: [PATCH 3/3] Add possibility to configure compute engine --- manifests/init.pp | 2 ++ templates/sonar.properties.erb | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 3a96b781..5103cd40 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -47,6 +47,8 @@ $http_proxy = {}, $profile = false, $web_java_opts = undef, + $ce_java_opts = undef, + $ce_workercount = undef, $search_java_opts = undef, $search_host = '127.0.0.1', $search_port = '9001', diff --git a/templates/sonar.properties.erb b/templates/sonar.properties.erb index c3a0e1df..6e28b907 100644 --- a/templates/sonar.properties.erb +++ b/templates/sonar.properties.erb @@ -103,6 +103,33 @@ sonar.web.https.keystoreType=<%= @https['keystoretype'] %> <% end -%> +#-------------------------------------------------------------------------------------------------- +# COMPUTE ENGINE +# The Compute Engine is responsible for processing background tasks. +# Compute Engine is executed in a dedicated Java process. Default heap size is 512Mb. +# Use the following property to customize JVM options. +# Recommendations: +# +# The HotSpot Server VM is recommended. The property -server should be added if server mode +# is not enabled by default on your environment: +# http://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html +# +<% if @ce_java_opts -%> +sonar.ce.javaOpts=<%= @ce_java_opts %> +<% end -%> + +# Same as previous property, but allows to not repeat all other settings like -Xmx +#sonar.ce.javaAdditionalOpts= +# The number of workers in the Compute Engine. Value must be greater than zero. +# By default the Compute Engine uses a single worker and therefore processes tasks one at a time. +# Recommendations: +# +# Using N workers will require N times as much Heap memory (see property +# sonar.ce.javaOpts to tune heap) and produce N times as much IOs on disk, database and +# Elasticsearch. The number of workers must suit your environment. +<% if @ce_workercount -%> +sonar.ce.workerCount=<%= @ce_workercount %> +<% end -%> #-------------------------------------------------------------------------------------------------- # ELASTICSEARCH