mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 18:55:58 +02:00
Create WAR files ready for deployment
This makes sure that the WAR files created by running "gradle stage" can be deployed by appcfg (tested the pubapi service on alpha). We need to copy all the static html files regardless of the service because the error.html handler is registered for sandbox and production environments across services. Without those files the gradle app engine plugin refuses to create the WAR files. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=233608424
This commit is contained in:
parent
0b3fee4ef1
commit
75c80b5e24
3 changed files with 33 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -82,7 +82,7 @@ autogenerated/
|
||||||
|
|
||||||
# We don't want to ignore the gradle jar files
|
# We don't want to ignore the gradle jar files
|
||||||
!/gradle/gradle/wrapper/**/*.jar
|
!/gradle/gradle/wrapper/**/*.jar
|
||||||
|
.gradle/
|
||||||
/gradle/.gradle
|
/gradle/.gradle
|
||||||
/gradle/**/WEB-INF
|
/gradle/**/WEB-INF
|
||||||
/gradle/**/build
|
/gradle/**/build
|
||||||
|
|
|
@ -30,6 +30,7 @@ steps:
|
||||||
- '-x'
|
- '-x'
|
||||||
- 'autoLintGradle'
|
- 'autoLintGradle'
|
||||||
- '-PrepositoryUrl=gcs://domain-registry-maven-repository'
|
- '-PrepositoryUrl=gcs://domain-registry-maven-repository'
|
||||||
|
- '-Penvironment=${_ENVIRONMENT}'
|
||||||
dir: 'gradle'
|
dir: 'gradle'
|
||||||
# Tar the deployment files as we cannot upload directories to GCS.
|
# Tar the deployment files as we cannot upload directories to GCS.
|
||||||
- name: 'alpine'
|
- name: 'alpine'
|
||||||
|
@ -47,12 +48,15 @@ steps:
|
||||||
# Tar files to upload to GCS.
|
# Tar files to upload to GCS.
|
||||||
artifacts:
|
artifacts:
|
||||||
objects:
|
objects:
|
||||||
location: 'gs://${PROJECT_ID}-deploy/${TAG_NAME}'
|
location: 'gs://${PROJECT_ID}-deploy/${TAG_NAME}/${_ENVIRONMENT}'
|
||||||
paths:
|
paths:
|
||||||
- 'gradle/services/default.tar'
|
- 'gradle/services/default.tar'
|
||||||
- 'gradle/services/pubapi.tar'
|
- 'gradle/services/pubapi.tar'
|
||||||
- 'gradle/services/backend.tar'
|
- 'gradle/services/backend.tar'
|
||||||
- 'gradle/services/tools.tar'
|
- 'gradle/services/tools.tar'
|
||||||
timeout: 3600s
|
timeout: 3600s
|
||||||
|
# Default values
|
||||||
|
substitutions:
|
||||||
|
_ENVIRONMENT: alpha
|
||||||
options:
|
options:
|
||||||
machineType: 'N1_HIGHCPU_8'
|
machineType: 'N1_HIGHCPU_8'
|
||||||
|
|
|
@ -224,16 +224,32 @@ subprojects {
|
||||||
':services:tools',
|
':services:tools',
|
||||||
':services:pubapi']
|
':services:pubapi']
|
||||||
|
|
||||||
|
def environments = ['production', 'sandbox', 'alpha', 'crash']
|
||||||
|
|
||||||
|
def projects = ['production': 'domain-registry',
|
||||||
|
'sandbox' : 'domain-registry-sandbox',
|
||||||
|
'alpha' : 'domain-registry-alpha',
|
||||||
|
'crash' : 'domain-registry-crash']
|
||||||
|
|
||||||
// Set up all of the deployment projects.
|
// Set up all of the deployment projects.
|
||||||
if (services.contains(project.path)) {
|
if (services.contains(project.path)) {
|
||||||
|
|
||||||
|
def environment = rootProject.findProperty("environment")
|
||||||
|
if (environment == null) {
|
||||||
|
environment = 'alpha'
|
||||||
|
}
|
||||||
|
def gcpProject = projects[environment]
|
||||||
|
if (gcpProject == null) {
|
||||||
|
throw new GradleException("-Penvironment must be one of ${environments}.")
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'war'
|
apply plugin: 'war'
|
||||||
|
|
||||||
// Set this directory before applying the appengine plugin so that the
|
// Set this directory before applying the appengine plugin so that the
|
||||||
// plugin will recognize this as an app-engine standard app (and also
|
// plugin will recognize this as an app-engine standard app (and also
|
||||||
// obtains the appengine-web.xml from the correct location)
|
// obtains the appengine-web.xml from the correct location)
|
||||||
project.convention.plugins['war'].webAppDirName =
|
project.convention.plugins['war'].webAppDirName =
|
||||||
"../../../java/google/registry/env/crash/${project.name}"
|
"../../../java/google/registry/env/${environment}/${project.name}"
|
||||||
|
|
||||||
apply plugin: 'com.google.cloud.tools.appengine'
|
apply plugin: 'com.google.cloud.tools.appengine'
|
||||||
|
|
||||||
|
@ -244,13 +260,19 @@ subprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.path.contains("default")) {
|
def coreResourcesDir = "${rootDir}/core/build/resources/main"
|
||||||
def coreResourcesDir = "${rootDir}/core/build/resources/main"
|
war {
|
||||||
|
from("${coreResourcesDir}/google/registry/ui/html") {
|
||||||
|
include "*.html"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project.path == ":services:default") {
|
||||||
war {
|
war {
|
||||||
from("${coreResourcesDir}/google/registry/ui") {
|
from("${coreResourcesDir}/google/registry/ui") {
|
||||||
include "registrar_bin*"
|
include "registrar_bin*"
|
||||||
into("assets/js")
|
into("assets/js")
|
||||||
rename { String filename -> filename.replace("bin", "dbg")}
|
rename { String filename -> filename.replace("bin", "dbg") }
|
||||||
}
|
}
|
||||||
from("${coreResourcesDir}/google/registry/ui") {
|
from("${coreResourcesDir}/google/registry/ui") {
|
||||||
include "registrar_bin*"
|
include "registrar_bin*"
|
||||||
|
@ -264,16 +286,13 @@ subprojects {
|
||||||
include "**/*"
|
include "**/*"
|
||||||
into("assets/images")
|
into("assets/images")
|
||||||
}
|
}
|
||||||
from("${coreResourcesDir}/google/registry/ui/html") {
|
|
||||||
include "*.html"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
appengine {
|
appengine {
|
||||||
deploy {
|
deploy {
|
||||||
// TODO: change this to a variable.
|
// TODO: change this to a variable.
|
||||||
project = 'domain-registry-crash'
|
project = gcpProject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue