From a1d3f7be8b9a7f08d2da3cc72090c4c7b40617d4 Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Fri, 14 Jun 2019 01:00:48 -0400 Subject: [PATCH] Add tasks used in release as dependencies of the build task Our CI (Travis & Kokoro) runs "gradle build", so we need to make sure that all tasks used in the release process are called during the build so that breakage can be caught earlier. In order to stage the GAE folder we need gcloud to be present. Therefore the Travis config is changed to install gcloud. See: https://gist.github.com/mjackson/5887963e7d8b8fb0615416c510ae8857 --- .travis.yml | 27 +++++++++++++++++++++++---- core/build.gradle | 4 ++++ proxy/build.gradle | 2 ++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e4f9d3919..103724f78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,6 @@ # usage (usually just wrapping it in single quotes should suffice). language: java -install: true jdk: # Our builds fail against Oracle Java for reasons yet unknown. - openjdk8 @@ -39,15 +38,35 @@ cache: directories: - $HOME/.gradle/caches/ - $HOME/.gradle/wrapper/ + - $HOME/google-cloud-sdk/ # WebDriver tests need Chrome and ChromeDriver provisioned by the docker image services: - docker env: - # Disable fancy status information (looks bad on travis and exceeds logfile - # quota) - TERM=dumb + global: + # Disable fancy status information (looks bad on travis and exceeds logfile + # quota) + - TERM=dumb + # Do not prompt for user input when using any SDK methods. + - CLOUDSDK_CORE_DISABLE_PROMPTS=1 +install: + - | + if [ ! -d $HOME/google-cloud-sdk/bin ] + then + # The install script errors if this directory already exists, + # but Travis already creates it when we mark it as cached. + rm -rf $HOME/google-cloud-sdk + # The install script is overly verbose, which sometimes causes + # problems on Travis, so ignore stdout. + curl https://sdk.cloud.google.com | bash + fi + # This line is critical. We setup the SDK to take precedence in our + # environment over the old SDK that is already on the machine. + - source $HOME/google-cloud-sdk/path.bash.inc + - gcloud components install app-engine-java + - gcloud version # Specialize gradle build to use an up-to-date gradle and the /gradle # directory. diff --git a/core/build.gradle b/core/build.gradle index 5e241b459..1003ce512 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -677,3 +677,7 @@ createUberJar('nomulus', 'nomulus', 'google.registry.tools.RegistryTool') createUberJar('gtechTool', 'gtech_tool', 'google.registry.tools.GtechTool') project.nomulus.dependsOn project(':third_party').jar project.gtechTool.dependsOn project(':third_party').jar + +project.build.dependsOn nomulus +project.build.dependsOn gtechTool +project.build.dependsOn ':stage' diff --git a/proxy/build.gradle b/proxy/build.gradle index 11079d070..9ed829df0 100644 --- a/proxy/build.gradle +++ b/proxy/build.gradle @@ -11,6 +11,8 @@ sourceSets { createUberJar('deployJar', 'proxy_server', 'google.registry.proxy.ProxyServer') +project.build.dependsOn deployJar + dependencies { def deps = rootProject.dependencyMap