mirror of
https://github.com/google/nomulus
synced 2026-01-08 15:21:46 +00:00
Refactor environment -> project map out of build (#300)
Move the project mapping into its own file so that it can be more easily overriden.
This commit is contained in:
11
build.gradle
11
build.gradle
@@ -119,14 +119,10 @@ task stage {
|
||||
|
||||
def environments = ['production', 'sandbox', 'alpha', 'crash']
|
||||
|
||||
// TODO(mmuller): Move this into internal specialization code.
|
||||
def projects = ['production': 'domain-registry',
|
||||
'sandbox' : 'domain-registry-sandbox',
|
||||
'alpha' : 'domain-registry-alpha',
|
||||
'crash' : 'domain-registry-crash']
|
||||
|
||||
def gcpProject = null
|
||||
|
||||
apply from: "${rootDir.path}/projects.gradle"
|
||||
|
||||
if (environment == '') {
|
||||
// Keep the project null, this will prevent deployment. Set the
|
||||
// environment to "alpha" because other code needs this property to
|
||||
@@ -135,7 +131,8 @@ if (environment == '') {
|
||||
} else if (environment != 'production' && environment != 'sandbox') {
|
||||
gcpProject = projects[environment]
|
||||
if (gcpProject == null) {
|
||||
throw new GradleException("-Penvironment must be one of ${environments}.")
|
||||
throw new GradleException("-Penvironment must be one of " +
|
||||
"${projects.keySet()}.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user