aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Yue Gan <yueg@google.com>2017-02-20 13:33:09 +0000
committerGravatar Irina Iancu <elenairina@google.com>2017-02-20 15:34:40 +0000
commite86550a5e82f28360cf49ec42318c52973dac93b (patch)
tree4b83773fab6b451f66e48afbfd0264bc08e57624 /scripts
parentaae324520e667b8872a048cef4886c35a1597a91 (diff)
Support pushing a file under directory.
-- PiperOrigin-RevId: 148015085 MOS_MIGRATED_REVID=148015085
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/build.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
index c2ca0e2b81..c09a18d1c1 100755
--- a/scripts/ci/build.sh
+++ b/scripts/ci/build.sh
@@ -518,28 +518,29 @@ function build_and_publish_site() {
}
# Push json file to perf site, also add to file_list
-# Input: $1 json file
+# Input: $1 json file to push
# $2 name of the bucket to deploy the site to
function push_benchmark_output_to_site() {
tmpdir=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXX)
trap 'rm -fr ${tmpdir}' EXIT
local gs="$(get_gsutil)"
- local filename="$1"
+ local output_file="$1"
+ local output_file_basename="$(basename ${output_file})"
local bucket="$2"
- if [ ! -f "${filename}"] || [ -z "${bucket}" ]; then
+ if [ ! -f "${output_file}" ] || [ -z "${bucket}" ]; then
echo "Usage: push_benchmark_output_to_site <json-file-name> <bucket>" >&2
return 1
fi
# Upload json file
- "${gs}" cp "${filename}" "gs://${bucket}/data/"
+ "${gs}" cp "${output_file}" "gs://${bucket}/data/${output_file_basename}"
# Download file_list (it might not exist)
"${gs}" cp "gs://${bucket}/file_list" "${tmpdir}" || true
# Update file_list
local list_file="${tmpdir}/file_list"
- echo "${filename}" >> "${list_file}"
+ echo "${output_file_basename}" >> "${list_file}"
"${gs}" cp "${list_file}" "gs://${bucket}/file_list"
"${gs}" -m acl ch -R -u AllUsers:R "gs://${bucket}"