Skip to content

Commit

Permalink
Merge pull request #308 from anshbansal/patch-27
Browse files Browse the repository at this point in the history
Added information regarding yml format.
  • Loading branch information
graemerocher committed Jul 8, 2015
2 parents e175bc2 + 239a1f0 commit be9e6ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/en/guide/conf/config/ymlOptions.gdoc
Original file line number Diff line number Diff line change
@@ -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}
1 change: 1 addition & 0 deletions src/en/guide/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be9e6ee

Please sign in to comment.