mirror of
https://github.com/google/nomulus.git
synced 2025-07-21 02:06:00 +02:00
Upload gradle binary to GCS when preparing the release
This makes it possible to pull the gradle binary from a trusted source when building the release artifacts. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=245450562
This commit is contained in:
parent
29b9f04aaa
commit
04f5901b2b
1 changed files with 27 additions and 1 deletions
|
@ -38,7 +38,7 @@ steps:
|
|||
rm -rf .git && rm -rf nomulus-internal/.git
|
||||
cp -rf nomulus-internal/* .
|
||||
rm -rf nomulus-internal
|
||||
# Build the builder image and tag the proxy base image, to be uploaded later.
|
||||
# Build the builder image and tag the proxy base image, then upload them to GCR.
|
||||
- name: 'gcr.io/cloud-builders/docker'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
|
@ -68,6 +68,32 @@ steps:
|
|||
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-proxy.yaml
|
||||
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-nomulus.yaml
|
||||
sed -i s/GCP_PROJECT/${PROJECT_ID}/ java/google/registry/proxy/kubernetes/proxy-*.yaml
|
||||
# Upload the gradle binary to GCS if it does not exist and point URL in gradle wrapper to it.
|
||||
- name: 'gcr.io/cloud-builders/gsutil'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
gradle_url=$(grep distributionUrl gradle/gradle/wrapper/gradle-wrapper.properties \
|
||||
| awk -F = '{print $2}' | sed 's/\\//g')
|
||||
gradle_bin=$(basename $gradle_url)
|
||||
gcs_loc="domain-registry-maven-repository/gradle"
|
||||
curl -O -L ${gradle_url}
|
||||
if gsutil -q stat gs://${gcs_loc}/${gradle_bin}
|
||||
then
|
||||
local_md5=$(md5sum ${gradle_bin} | awk '{print $1}')
|
||||
remote_md5=$(gsutil hash -h gs://${gcs_loc}/${gradle_bin} | grep md5 | awk '{print $3}')
|
||||
if [[ ${local_md5} != ${remote_md5} ]]
|
||||
then
|
||||
echo "${gradle_bin} HAS CHANGED ON GRADLE WEBSITE, USING THE BINARY ON GCS."
|
||||
fi
|
||||
else
|
||||
gsutil cp $gradle_bin gs://${gcs_loc}/
|
||||
gsutil acl ch -u AllUsers:R gs://${gcs_loc}/${gradle_bin}
|
||||
fi
|
||||
rm ${gradle_bin}
|
||||
sed -i s%services.gradle.org/distributions%storage.googleapis.com/${gcs_loc}% \
|
||||
gradle/gradle/wrapper/gradle-wrapper.properties
|
||||
# Check out the release repo.
|
||||
- name: 'gcr.io/cloud-builders/gcloud'
|
||||
args: ['source', 'repos', 'clone', 'nomulus-release']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue