Skip to content

Commit

Permalink
Add shellcheck to Travis tests and fix existing shell lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Jul 13, 2016
1 parent 60deba5 commit a7d7fd4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
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

0 comments on commit a7d7fd4

Please sign in to comment.