mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00:00
Fix console build for GKE (#2713)
We use the $environment property to set the console config. If it is not given, 'alpha' is used, which has the same effect as 'production'. TESTED=ran :jetty:copyConsole with -Penvironment=(sandbox|production|alpha) and checked the resulting js file.
This commit is contained in:
@@ -95,11 +95,6 @@ task stage {
|
||||
description = 'Generates application directories for all services.'
|
||||
}
|
||||
|
||||
// App-engine environment configuration. We set up all of the variables in
|
||||
// the root project.
|
||||
|
||||
def environments = ['production', 'sandbox', 'alpha', 'crash', 'qa']
|
||||
|
||||
def gcpProject = null
|
||||
|
||||
apply from: "${rootDir.path}/projects.gradle"
|
||||
@@ -109,12 +104,13 @@ if (environment == '') {
|
||||
// environment to "alpha" because other code needs this property to
|
||||
// explode the war file.
|
||||
environment = 'alpha'
|
||||
} else if (environment != 'production' && environment != 'sandbox') {
|
||||
} else {
|
||||
gcpProject = projects[environment]
|
||||
if (gcpProject == null) {
|
||||
throw new GradleException("-Penvironment must be one of " +
|
||||
"${projects.keySet()}.")
|
||||
}
|
||||
project(':console-webapp').setProperty('configuration', environment)
|
||||
}
|
||||
|
||||
rootProject.ext.environment = environment
|
||||
|
||||
@@ -40,9 +40,7 @@ task runConsoleWebappUnitTests(type: Exec) {
|
||||
task buildConsoleWebapp(type: Exec) {
|
||||
workingDir "${consoleDir}/"
|
||||
executable 'npm'
|
||||
def configuration = project.hasProperty('configuration') ?
|
||||
project.getProperty('configuration') :
|
||||
'production'
|
||||
def configuration = project.getProperty('configuration')
|
||||
args 'run', "build", "--configuration=${configuration}"
|
||||
doFirst {
|
||||
println "Building console for environment: ${configuration}"
|
||||
|
||||
1
console-webapp/gradle.properties
Normal file
1
console-webapp/gradle.properties
Normal file
@@ -0,0 +1 @@
|
||||
configuration=production
|
||||
@@ -51,7 +51,7 @@ else
|
||||
mv services/"${service}"/build/staged-app "${dest}/${service}"
|
||||
done
|
||||
|
||||
./gradlew :console-webapp:buildConsoleWebapp -Pconfiguration="${environment}"
|
||||
./gradlew :console-webapp:buildConsoleWebapp -Penvironment="${environment}"
|
||||
mkdir -p "${dest}/console" && cp -r console-webapp/staged/* "${dest}/console"
|
||||
|
||||
mv core/build/resources/main/google/registry/env/common/META-INF \
|
||||
|
||||
Reference in New Issue
Block a user