diff --git a/config/nom_build.py b/config/nom_build.py index 584d4618d..315396f23 100644 --- a/config/nom_build.py +++ b/config/nom_build.py @@ -57,6 +57,7 @@ PROPERTIES_HEADER = """\ # # DO NOT EDIT THIS FILE BY HAND org.gradle.jvmargs=-Xmx1024m +org.gradle.caching=true """ # Help text to be displayed (in addition to the synopsis and flag help, which diff --git a/gradle.properties b/gradle.properties index 0cbe2c4d8..2f7a7d20e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,7 @@ # # DO NOT EDIT THIS FILE BY HAND org.gradle.jvmargs=-Xmx1024m +org.gradle.caching=true mavenUrl= pluginsUrl= uploaderDestination= diff --git a/release/build_nomulus_for_env.sh b/release/build_nomulus_for_env.sh index 99d1c7390..e5733b9e7 100755 --- a/release/build_nomulus_for_env.sh +++ b/release/build_nomulus_for_env.sh @@ -29,19 +29,11 @@ environment="$1" dest="$2" gcs_prefix="gcs://domain-registry-maven-repository" -# Let Gradle put its caches (dependency cache and build cache) in the source -# tree. This allows sharing of the caches between steps in a Cloud Build -# task. (See ./cloudbuild-nomulus.yaml, which calls this script in several -# steps). If left at their default location, the caches will be lost after -# each step. -# Note: must be consistent with value in ./cloudbuild-nomulus.yaml -export GRADLE_USER_HOME="./cloudbuild-caches" - if [ "${environment}" == tool ] then mkdir -p "${dest}" - ./gradlew clean :core:buildToolImage \ + ./gradlew :core:buildToolImage \ -PmavenUrl="${gcs_prefix}"/maven \ -PpluginsUrl="${gcs_prefix}"/plugins @@ -50,7 +42,7 @@ else dest="${dest}/$1" mkdir -p "${dest}" - ./gradlew clean stage -Penvironment="${environment}" \ + ./gradlew stage -Penvironment="${environment}" \ -PmavenUrl="${gcs_prefix}"/maven \ -PpluginsUrl="${gcs_prefix}"/plugins diff --git a/release/cloudbuild-nomulus.yaml b/release/cloudbuild-nomulus.yaml index 3c9b732e7..f0e96e22d 100644 --- a/release/cloudbuild-nomulus.yaml +++ b/release/cloudbuild-nomulus.yaml @@ -23,16 +23,27 @@ steps: - name: 'gcr.io/${PROJECT_ID}/builder:latest' # Set home for Gradle caches. Must be consistent with last step below # and ./build_nomulus_for_env.sh - env: [ 'GRADLE_USER_HOME=./cloudbuild-caches' ] + env: [ 'GRADLE_USER_HOME=/workspace/cloudbuild-caches' ] args: ['./gradlew', 'test', '-PskipDockerIncompatibleTests=true', '-PmavenUrl=gcs://domain-registry-maven-repository/maven', '-PpluginsUrl=gcs://domain-registry-maven-repository/plugins' ] -# Build the tool binary and image. +# Build and package the deployment files for each environment, and the tool +# binary and image. - name: 'gcr.io/${PROJECT_ID}/builder:latest' - args: ['release/build_nomulus_for_env.sh', 'tool', 'output'] + # Set home for Gradle caches. Must be consistent with last step below + # and ./build_nomulus_for_env.sh + env: [ 'GRADLE_USER_HOME=/workspace/cloudbuild-caches' ] + entrypoint: /bin/bash + args: + - -c + - | + for _env in tool alpha crash sandbox production + do + release/build_nomulus_for_env.sh $${_env} output + done # Save TAG_NAME in ./output/tag_name, to be uploaded later. This file is purely # informational. It makes it easier to tell the tag of the current 'live' release. - name: 'gcr.io/${PROJECT_ID}/builder:latest' @@ -61,24 +72,12 @@ steps: sed -i s/'$${_IMAGE}'/nomulus-tool/g release/cloudbuild-tag.yaml sed -i s/':$${TAG_NAME}'/@$digest/g release/cloudbuild-tag.yaml sed -i s/'nomulus-tool:latest'/nomulus-tool@$digest/g release/cloudbuild-deploy-*.yaml -# Build and package the deployment files for alpha. -- name: 'gcr.io/${PROJECT_ID}/builder:latest' - args: ['release/build_nomulus_for_env.sh', 'alpha', 'output'] -# Build and package the deployment files for crash. -- name: 'gcr.io/${PROJECT_ID}/builder:latest' - args: ['release/build_nomulus_for_env.sh', 'crash', 'output'] -# Build and package the deployment files for sandbox. -- name: 'gcr.io/${PROJECT_ID}/builder:latest' - args: ['release/build_nomulus_for_env.sh', 'sandbox', 'output'] -# Build and package the deployment files for production. -- name: 'gcr.io/${PROJECT_ID}/builder:latest' - args: ['release/build_nomulus_for_env.sh', 'production', 'output'] # Build and stage Dataflow Flex templates. - name: 'gcr.io/${PROJECT_ID}/builder:latest' entrypoint: /bin/bash # Set home for Gradle caches. Must be consistent with previous steps above # and ./build_nomulus_for_env.sh - env: [ 'GRADLE_USER_HOME=./cloudbuild-caches' ] + env: [ 'GRADLE_USER_HOME=/workspace/cloudbuild-caches' ] args: - -c - | @@ -108,7 +107,7 @@ steps: entrypoint: /bin/bash # Set home for Gradle caches. Must be consistent with previous steps above # and ./build_nomulus_for_env.sh - env: [ 'GRADLE_USER_HOME=./cloudbuild-caches' ] + env: [ 'GRADLE_USER_HOME=/workspace/cloudbuild-caches' ] args: - -c - | diff --git a/release/stage_beam_pipeline.sh b/release/stage_beam_pipeline.sh index cd4d84053..f774f7431 100755 --- a/release/stage_beam_pipeline.sh +++ b/release/stage_beam_pipeline.sh @@ -53,7 +53,7 @@ shift 4 maven_gcs_prefix="gcs://domain-registry-maven-repository" nom_build_dir="$(dirname $0)/.." -${nom_build_dir}/nom_build clean :core:"${uberjar_task}" \ +${nom_build_dir}/nom_build :core:"${uberjar_task}" \ --mavenUrl="${maven_gcs_prefix}"/maven \ --pluginsUrl="${maven_gcs_prefix}"/plugins