From 2a00b2b6a7a3942a9bcffe29d91baf44663823c7 Mon Sep 17 00:00:00 2001 From: Miah Johnson Date: Thu, 17 Oct 2019 16:37:47 -0700 Subject: [PATCH] Clean up variable usage, and use download_s3_file Signed-off-by: Miah Johnson --- .expeditor/buildkite/coverage.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.expeditor/buildkite/coverage.sh b/.expeditor/buildkite/coverage.sh index 5f5368915..5d33b1a34 100644 --- a/.expeditor/buildkite/coverage.sh +++ b/.expeditor/buildkite/coverage.sh @@ -6,26 +6,26 @@ export LANG=C.UTF-8 LANGUAGE=C.UTF-8 # test-reporter expects reporter identifier under this environment variable CC_TEST_REPORTER_ID="FIXME" TEST_REPORTER_VERSION="0.6.3" -S3_URL="s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}" +S3_URL="s3://public-cd-buildkite-cache/$BUILDKITE_PIPELINE_SLUG/$BUILDKITE_LABEL" download_test_reporter() { - curl -o test-reporter -L https://codeclimate.com/downloads/test-reporter/test-reporter-"${TEST_REPORTER_VERSION}"-linux-amd64 + curl -o test-reporter -L https://codeclimate.com/downloads/test-reporter/test-reporter-"$TEST_REPORTER_VERSION"-linux-amd64 chmod +x test-reporter } download_s3_file() { - aws s3 cp "${S3_URL}/$1" "$1" + aws s3 cp "$S3_URL/$1" "$1" } upload_s3_file() { if [ -f "$1" ]; then - aws s3 cp "$1" "${S3_URL}/$1" || echo "Could not push $1 to S3 for caching." + aws s3 cp "$1" "$S3_URL/$1" || echo "Could not push $1 to S3 for caching." fi } echo "--- downloading coverage tool" -aws s3 cp "${S3_URL}/test-reporter" || download_test_reporter -aws s3 cp "${S3_URL}/test-reporter.sha" || echo "Could not download test-reporter.sha" +download_s3_file test-reporter || download_test_reporter +download_s3_file test-reporter.sha || echo "Could not download test-reporter.sha" echo "--- updating rubygems" @@ -47,9 +47,9 @@ bundle exec rake "${RAKE_TASK:-}" EXIT-CODE=$? echo "+++ formatting and uploading test coverage" -./test-reporter after-build -t simplecov --exit-code $EXIT_CODE +./test-reporter after-build -t simplecov --exit-code "$EXIT_CODE" -echo "--- uploading test-reporter{.sha} to s3" +echo "--- uploading test-reporter.sha to s3" if [ "test-reporter" -nt "test-reporter.sha" ]; then if shasum --check test-reporter.sha --status; then shasum -a 256 test-reporter > test-reporter.sha