Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shellcheck to Travis tests and fix existing shell lint errors. #273

Merged
merged 1 commit into from
Jul 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jdk:
- oraclejdk8
addons:
apt:
sources:
# Grab shellcheck from the Debian repo.
# https://github.com/koalaman/shellcheck/wiki/TravisCI
- debian-sid
packages:
- expect
- shellcheck
before_install:
- openssl aes-256-cbc -K $encrypted_d17a6ce39290_key -iv $encrypted_d17a6ce39290_iv
-in gae-firebase-secrets.json.enc -out appengine/firebase-event-proxy/gae-firebase-event-proxy/src/main/webapp/gae-firebase-secrets.json
Expand Down
2 changes: 1 addition & 1 deletion speech/grpc/bin/speech-sample-async.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# limitations under the License.

SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
java -cp "${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar" \
com.examples.cloud.speech.AsyncRecognizeClient "$@"
2 changes: 1 addition & 1 deletion speech/grpc/bin/speech-sample-streaming.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# limitations under the License.

SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
java -cp "${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar" \
com.examples.cloud.speech.StreamingRecognizeClient "$@"
2 changes: 1 addition & 1 deletion speech/grpc/bin/speech-sample-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# limitations under the License.

SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
java -cp "${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar" \
com.examples.cloud.speech.SyncRecognizeClient "$@"
8 changes: 6 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ set -e
set -x
# Set pipefail so that `egrep` does not eat the exit code.
set -o pipefail
shopt -s globstar

SKIP_TESTS=false
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS"]; then
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ] ; then
SKIP_TESTS=true
fi
mvn --batch-mode clean verify -DskipTests=$SKIP_TESTS | egrep -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
Expand All @@ -32,7 +33,10 @@ devserver_tests=(
appengine/datastore/indexes-exploding
appengine/datastore/indexes-perfect
)
for testdir in ${devserver_tests[@]} ; do
for testdir in "${devserver_tests[@]}" ; do
./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}"
done

# Check that all shell scripts in this repo (including this one) pass the
# Shell Check linter.
shellcheck ./**/*.sh