Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions release/cloudbuild-dev-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
steps:
# Download saved Gradle distribution from GCS and install it.
- name: 'gcr.io/${PROJECT_ID}/builder:live'
entrypoint: ./release/install_gradle.sh
# Compile javadoc
- name: 'gcr.io/${PROJECT_ID}/builder:live'
entrypoint: /bin/bash
Expand Down
1 change: 1 addition & 0 deletions release/cloudbuild-kythe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ steps:
export KYTHE_OUTPUT_DIRECTORY="$${PWD}/kythe_output"
mkdir -p $${KYTHE_OUTPUT_DIRECTORY}
mkdir -p $${KYTHE_OUTPUT_DIRECTORY}/merged
./release/install_gradle.sh
./gradlew clean testClasses \
-Dno_werror=true -PenableCrossReferencing=true
# Merge kzip files
Expand Down
3 changes: 3 additions & 0 deletions release/cloudbuild-nomulus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ steps:
# Create a directory to store the artifacts
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
args: ['mkdir', 'nomulus']
# Download saved Gradle distribution from GCS and install it.
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
entrypoint: ./release/install_gradle.sh
# Run tests
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
# Set home for Gradle caches. Must be consistent with last step below
Expand Down
3 changes: 3 additions & 0 deletions release/cloudbuild-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
steps:
# Download saved Gradle distribution from GCS and install it.
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
entrypoint: ./release/install_gradle.sh
# Build the proxy docker image.
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
args:
Expand Down
1 change: 0 additions & 1 deletion release/cloudbuild-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ steps:
fi
else
gcloud storage cp $gradle_bin gs://${gcs_loc}/
gcloud storage objects update --predefined-acl=publicRead gs://${gcs_loc}/${gradle_bin}
fi
rm ${gradle_bin}
sed -i s%services.gradle.org/distributions%storage.googleapis.com/${gcs_loc}% \
Expand Down
32 changes: 32 additions & 0 deletions release/install_gradle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright 2019 The Nomulus Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This script should be invoked from the Gradle root. It downloads the
# gradle distribution saved on GCS, and sets Gradle's distribution URL
# to the local copy. This is necessary since when accessing a GCS bucket
# using http, the bucket must have public access, which is forbidden by
# our policy.

set -e

gradle_url=$(grep distributionUrl gradle/wrapper/gradle-wrapper.properties \
| awk -F = '{print $2}' | sed 's/\\//g')
gradle_bin=$(basename $gradle_url)
gcs_loc="domain-registry-maven-repository/gradle"

gcloud storage cp "gs://${gcs_loc}/${gradle_bin}" .
local_url="file\\\://${PWD}/${gradle_bin}"
sed -i "s#distributionUrl=.*#distributionUrl=${local_url}#" \
gradle/wrapper/gradle-wrapper.properties
Loading