Is there a way to start the sonarqube server with an external sonar.properties file?

I want to know if there is a way to start the SonarQube (5.0.1) server with external sonar.properties and wrapper.conf files.

I am looking at something similar to the apache "-f" option -

/apache2/bin/apachectl -f /path/to/httpd.conf

Thank.

==================================================== ======

As mentioned in the answer below, I tried to reference properties with environment variables. This works for certain properties. ex. sonar.jdbc.username and sonar.jdbc.password

This did not work for me as a property value that has several 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 get -

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.').

=============================================== ===========

env -

$echo $MYSQL_DB_URL
jdbc:mysql://devdbXXX:6000/sonar?useUnicode=true

-

--> 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

, URL- mysql.

-, URL-, ...

+4
2

UBUNTU: . sonar.sh bin sonarqube

#! /bin/sh

#
# Copyright (c) 1999, 2006 Tanuki Software Inc.
#
# Java Service Wrapper sh script.  Suitable for starting and stopping
#  wrapped Java applications on UNIX platforms.
#

#-----------------------------------------------------------------------------
# These settings can be modified to fit the needs of your application

# Default values for the Application variables, below. 
# 
# NOTE: The build for specific applications may override this during the resource-copying
# phase, to fill in a concrete name and avoid the use of the defaults specified here.
DEF_APP_NAME="SonarQube"
DEF_APP_LONG_NAME="SonarQube"

# Application
APP_NAME="${DEF_APP_NAME}"
APP_LONG_NAME="${DEF_APP_LONG_NAME}"

# Wrapper
WRAPPER_CMD="./wrapper"
WRAPPER_CONF="../../conf/wrapper.conf"

# Priority at which to run the wrapper.  See "man nice" for valid priorities.
#  nice is only used if a priority is specified.
PRIORITY=

# Location of the pid file.
PIDDIR="."

- WRAPPER_CONF=, sonar.properties sonarqube conf , . start.sh, . (, -sp -wc conf)

+4

sonar.properties .

sonarqube/5.0.1/conf/sonar.properties header >

# Property values can:
 # - reference an environment variable, for example sonar.jdbc.url= ${env:SONAR_JDBC_URL}

, , .

+1

All Articles