diff --git a/src/en/guide/conf/config/ymlOptions.gdoc b/src/en/guide/conf/config/ymlOptions.gdoc new file mode 100644 index 00000000000..6e150916e94 --- /dev/null +++ b/src/en/guide/conf/config/ymlOptions.gdoc @@ -0,0 +1,21 @@ +@application.yml@ was introduced in Grails 3.0 for an alternative format for the configuration tasks. + +h3. Using system properties / command line arguments + +Suppose you are using the @JDBC_CONNECTION_STRING@ command line argument and you want to access the same in the yml file then it can be done in the following manner: + +{code:java} +production: + dataSource: + url: '${JDBC_CONNECTION_STRING}' +{code} + +Similarly system arguments can be accessed. + +You will need to have this in @build.gradle@ to modify the @bootRun@ target if @grails run-app@ is used to start the application + +{code:java} +run { + systemProperties = System.properties +} +{code} diff --git a/src/en/guide/toc.yml b/src/en/guide/toc.yml index 0fc022e1546..243f3b7ede1 100644 --- a/src/en/guide/toc.yml +++ b/src/en/guide/toc.yml @@ -29,6 +29,7 @@ conf: title: Configuration config: title: Basic Configuration + ymlOptions: Options for the yml format Config builtInOptions: Built in options logging: Logging configGORM: GORM