Remove sudo from brew installs
Brew doesn't like being run as sudo:
https://travis-ci.org/google/bazel/jobs/57091620
--
MOS_MIGRATED_REVID=90412367
diff --git a/.travis.yml b/.travis.yml
index 0a0a2fc..f383fc0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,10 +8,13 @@
- clang
jdk:
- oraclejdk8
-script:
+before_script:
- .travis/setup-env.sh
+script:
- jdk_switcher use oraclejdk8
- ./compile.sh
+after_script:
+ - .travis/teardown-env.sh
# Upload to S3.
addons:
diff --git a/.travis/setup-env.sh b/.travis/setup-env.sh
index 2b29648..58dd5a8 100755
--- a/.travis/setup-env.sh
+++ b/.travis/setup-env.sh
@@ -22,7 +22,7 @@
fi
if [[ $TRAVIS_OS_NAME = 'osx' ]]; then
- sudo brew install protobuf libarchive
+ brew install protobuf libarchive
else
sudo apt-get update -qq
sudo apt-get install -y protobuf-compiler libarchive-dev
diff --git a/.travis/teardown-env.sh b/.travis/teardown-env.sh
new file mode 100755
index 0000000..d09aae0
--- /dev/null
+++ b/.travis/teardown-env.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Copyright 2015 Google Inc. 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.
+
+set -eux
+
+# Remove all of the files the build generated that we don't want uploaded
+# to S3.
+# TODO(kchodorow): change this to the bootstrapped binary.
+mv output/bazel bazel
+rm -rf output
+rm -rf bazel-*