aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2015-04-09 23:00:05 +0000
committerGravatar Ulf Adams <ulfjack@google.com>2015-04-10 08:03:48 +0000
commitf7cf477913ae9c14f77a2d0d689b4207e3d51c37 (patch)
tree608abf3ae5ac1ba1f7c4ab99282f8be5c37926cb
parent48f321dd0f8017a3b2ebe8547219e359f6535a6b (diff)
Add mailing list notifications and deploy binaries in a more organized way
-- MOS_MIGRATED_REVID=90756540
-rw-r--r--.travis.yml6
-rwxr-xr-x.travis/prepare-for-deploy.sh51
2 files changed, 46 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index d180b32c05..b78a726972 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,7 @@
+notifications:
+ email:
+ - bazel-dev@googlegroups.com
+
# Allow sudo for running apt-get.
sudo: required
language: cpp
@@ -21,6 +25,6 @@ deploy:
secret_access_key:
secure: KXlQaKk1G527mZ7hC+m8rblBZrOWQJr6uPX9M5S3XpSAehBDBQ26/pwvDutbQBolsvUfd+WgsXU28JINk89B1qA4HpNax0ucveM5C1K4mC5fR5EmtCThV4MDsmirzfVmAxUMOXowUjpyYX39+f+Yy2Y6GHhftIe9WaueCYJyg0I=
bucket: bucket-o-bazel
- local_dir: output
+ local_dir: ci
acl: public-read
skip_cleanup: true
diff --git a/.travis/prepare-for-deploy.sh b/.travis/prepare-for-deploy.sh
index 6b35caaaf7..848741c8f3 100755
--- a/.travis/prepare-for-deploy.sh
+++ b/.travis/prepare-for-deploy.sh
@@ -16,13 +16,44 @@
set -eux
-# Remove all of the files that we don't want uploaded to GCS. Shuffle the bazel
-# binary around so it ends up being the only thing uploaded.
-# TODO(kchodorow): right now this is uploading the binary generated by
-# ./compile.sh. Once bazel can bootstrap itself on Travis, change this to upload
-# the bootstrapped binary, instead.
-echo "pwd: $(pwd)" 1>&2
-ls -l 1>&2
-mv output/bazel bazel
-rm -rf output/*
-mv bazel output/bazel
+# Create a zip with:
+# * The binary.
+# * A sha256 sum of the binary.
+# * A README with info about the build.
+function create_zip() {
+ local git_hash
+ git_hash=$(git rev-parse --short HEAD)
+ local bazel_dir
+ bazel_dir=bazel-$git_hash
+ mkdir $bazel_dir
+ # TODO(kchodorow): right now this is uploading the binary generated by
+ # ./compile.sh. Once bazel can bootstrap itself on Travis, change this to
+ # upload the bootstrapped binary, instead.
+ cp output/bazel $bazel_dir
+ sha256sum $bazel_dir/bazel > $bazel_dir/sha256.txt
+ cat > $bazel_dir/README.md <<EOF
+Build ID: $TRAVIS_BUILD_ID
+Build Number: $TRAVIS_BUILD_NUMBER
+Job ID: $TRAVIS_JOB_ID
+Job Number: $TRAVIS_JOB_NUMBER
+From repo $TRAVIS_REPO_SLUG at commit $git_hash.
+EOF
+ bazel_zip=bazel-${git_hash}.zip
+ echo "Creating $bazel_zip"
+ zip -r -qq $bazel_zip $bazel_dir
+ rm -r $bazel_dir
+}
+
+# Put the bazel zip in an uploaded dir.
+function copy_to_upload_dir() {
+ local date_dir=$(date +%F)
+ local upload_dir=ci/$date_dir/
+ mkdir -p $upload_dir
+ mv $bazel_zip $upload_dir
+ # Create a symlink to "latest" in the dir.
+ (cd $upload_dir; ln -s $bazel_zip bazel.zip)
+ echo "$bazel_zip moved to $upload_dir"
+}
+
+create_zip
+copy_to_upload_dir