aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Yue Gan <yueg@google.com>2017-02-15 09:43:56 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2017-02-15 10:06:33 +0000
commitadaeaed85286aa27a682239c84e69a56cacf20c8 (patch)
tree06c0fb3ae6d32e160b2386aa507c1c136300807a /scripts
parentd7d951ddcbc0936bf973e986e44ba929d0bb6a1e (diff)
*** Reason for rollback *** Fix CI build *** Original change description *** Automated [] rollback of commit 01aa7d6f177f3284b5fecc0397bf29a605b37df0. *** Reason for rollback *** Breaks the CI: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.7,PLATFORM_NAME=linux-x86_64/1270/console *** Original change description *** Adds support for pushing sites that don't need build, and build benchmark site. This should not affect CI for now. -- PiperOrigin-RevId: 147572787 MOS_MIGRATED_REVID=147572787
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/build.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
index 8474c2db8d..bb863baa00 100755
--- a/scripts/ci/build.sh
+++ b/scripts/ci/build.sh
@@ -126,7 +126,7 @@ function bazel_build() {
xcodebuild -showsdks 2> /dev/null | grep -q '\-sdk iphonesimulator'; then
ARGS="--define IPHONE_SDK=1"
fi
- local OPTIONAL_TARGETS="//site:jekyll-tree //scripts/packages"
+ local OPTIONAL_TARGETS="//site:jekyll-tree //scripts/packages //src/tools/benchmark/webapp:site"
if [[ $PLATFORM =~ "freebsd" ]] ; then
OPTIONAL_TARGETS=
fi
@@ -150,6 +150,7 @@ function bazel_build() {
cp bazel-genfiles/bazel-distfile.zip $1/bazel-${release_label}-dist.zip
fi
cp bazel-genfiles/site/jekyll-tree.tar $1/www.bazel.build.tar
+ cp bazel-bin/src/tools/benchmark/webapp/site.tar $1/perf.bazel.build.tar.nobuild
cp bazel-genfiles/scripts/packages/README.md $1/README.md
fi
}
@@ -486,6 +487,7 @@ function bazel_release() {
# Use jekyll build to build the site and then gsutil to copy it to GCS
# Input: $1 tarball to the jekyll site
# $2 name of the bucket to deploy the site to
+# $3 "nobuild" if only publish without build
# It requires to have gsutil installed. You can force the path to gsutil
# by setting the GSUTIL environment variable
function build_and_publish_site() {
@@ -494,17 +496,23 @@ function build_and_publish_site() {
local gs="$(get_gsutil)"
local site="$1"
local bucket="$2"
+ local nobuild="$3"
if [ ! -f "${site}" ] || [ -z "${bucket}" ]; then
echo "Usage: build_and_publish_site <site-tarball> <bucket>" >&2
return 1
fi
- tar xf "${site}" --exclude=CNAME -C "${tmpdir}"
- jekyll build -s "${tmpdir}" -d "${tmpdir}/production"
+ local prod_dir="${tmpdir}"
+ if [ "$nobuild" != "nobuild" ]; then
+ tar xf "${site}" --exclude=CNAME -C "${tmpdir}"
+ jekyll build -s "${tmpdir}" -d "${tmpdir}/production"
+ prod_dir="${tmpdir}/production"
+ fi
+
# Rsync:
# -r: recursive
# -c: compute checksum even though the input is from the filesystem
- "${gs}" rsync -r -c "${tmpdir}/production" "gs://${bucket}"
+ "${gs}" rsync -r -c "${prod_dir}" "gs://${bucket}"
"${gs}" web set -m index.html -e 404.html "gs://${bucket}"
"${gs}" -m acl ch -R -u AllUsers:R "gs://${bucket}"
}