-
Notifications
You must be signed in to change notification settings - Fork 1
Multiple Environment sample
bluepapa32/gradle-environment-sample
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Multiple Environment sample ----------------------------------------------------------------------------- $ git clone https://github.com/bluepapa32/gradle-environment-sample.git $ git checkout 20110317 $ cd gradle-environment-sample ========================= Use default environment ========================= $ ./gradlew -q server.url: http://app:8080/setting database.driverClassName: org.hsqldb.jdbcDriver database.url: jdbc:hsqldb:mem:devDB database.username: bluepapa32 database.password: ================================================= Specify the test environment with the -P option ================================================= $ ./gradlew -q -Penv=test server.url: http://app/setting database.driverClassName: org.hsqldb.jdbcDriver database.url: jdbc:hsqldb:mem:testDB database.username: bluepapa32 database.password: ============================================================================= Specify the production environment with the GRADLE_ENV environment variable ============================================================================= $ GRADLE_ENV=production ./gradlew -q server.url: https://app/setting database.driverClassName: oracle.jdbc.driver.OracleDriver database.url: jdbc:oracle:thin:dbserv:1521:prodDb database.username: bluepapa32 database.password: =================================================================== Specify the test environment with $HOME/.gradle/gradle.properties =================================================================== $ echo "env=test" >> $HOME/.gradle/gradle.properties $ ./gradlew -q server.url: http://app/setting database.driverClassName: org.hsqldb.jdbcDriver database.url: jdbc:hsqldb:mem:testDB database.username: bluepapa32 database.password: ====================================== Use $HOME/.gradle/environment.gradle ====================================== $ vi $HOME/.gradle/environment.gradle database { password = 'secret' } $ ./gradlew -q -Penv=production server.url: https://app/setting database.driverClassName: oracle.jdbc.driver.OracleDriver database.url: jdbc:oracle:thin:dbserv:1521:prodDb database.username: bluepapa32 database.password: secret -----------------------------------------------------------------------------
About
Multiple Environment sample
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published