I want to know if there is a way to start a SonarQube (5.0.1) server with an external sonar.properties and wrapper.conf files.
I am looking at something similar to apache "-f" option -
/apache2/bin/apachectl -f /path/to/httpd.conf
Thanks.
========================================================
As mentioned in the answer below, I tried to reference the properties with environment variables. This works for certain properties. ex. sonar.jdbc.username & sonar.jdbc.password
It did not work for me for as a property value that has multiple environment variables.
Ex. sonar.jdbc.url=jdbc:mysql://${env:MYSQL_HOST}:${env:MYSQL_PORT}/sonar= ?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
Here is the exception I am getting -
2015.03.17 11:48:33 INFO web[o.s.c.p.Database] Create JDBC datasource for= jdbc:mysql://${env:MYSQL_HOST}:${env:MYSQL_PORT}/sonar?useUnicode=3Dtrue&c=
haracterEncoding=3Dutf8&rewriteBatchedStatements=3Dtrue
2015.03.17 11:48:33 ERROR web[o.a.c.c.C.[.[.[/sonar]] Exception sending co= ntext initialized event to listener instance of class org.sonar.server.plat= form.PlatformServletContextListener
java.lang.IllegalStateException: Can not connect to database. Please check = connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
==========================================================
I also tried with having only one env variable -
$echo $MYSQL_DB_URL
jdbc:mysql://devdbXXX:6000/sonar?useUnicode=true
Getting this exception -
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
WrapperSimpleApp: Encountered an error running main: org.sonar.process.MessageException: Bad format of JDBC URL: ${env:MYSQL_DB_URL}
org.sonar.process.MessageException: Bad format of JDBC URL: ${env:MYSQL_DB_URL}
<-- Wrapper Stopped
This works if I hardcode the mysql host url.
Something to do with URL formatting, Still debugging...