From c319fb3ff2a1529a06ddabf36e0d6c5a2a93f8d2 Mon Sep 17 00:00:00 2001 From: Igor Dvorzhak Date: Thu, 13 Jun 2019 11:28:51 -0700 Subject: [PATCH] Ignore temp files (#567) --- .gitignore | 6 ++++++ push-to-gcs.sh | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..6d7240c92 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Ignore IntelliJ project files +.idea/ +*.iml + +# Ignore Python cache files after running tests +*/__pycache__/ diff --git a/push-to-gcs.sh b/push-to-gcs.sh index 76edf5330..9e4b2f5ca 100755 --- a/push-to-gcs.sh +++ b/push-to-gcs.sh @@ -11,9 +11,9 @@ set -euo pipefail [[ $# -eq 2 ]] || { - echo "Usage: ./push-to-gcs.sh " - echo "Example: ./push-to-gcs.sh cbde05 kafka" - exit 1 + echo "Usage: ./push-to-gcs.sh " + echo "Example: ./push-to-gcs.sh cbde05 kafka" + exit 1 } set -x @@ -43,14 +43,14 @@ if [[ ! -d "${MODULE}" ]]; then fi # Verify shell scripts have permission mode 75x. -for file in ${MODULE}/*.sh; do - if [[ "$(stat -c '%a' ${file})" != 75* ]]; then - echo "The permission mode of script ${file} is $(stat -c '%a' ${file}), expected: 75x." +for file in "${MODULE}/"*.sh; do + permissions=$(stat -c '%a' "${file}") + if [[ ${permissions} != 75* ]]; then + echo "The permission mode of script ${file} is ${permissions}, expected: 75x." exit 5 fi done -gsutil -m rsync -R "${MODULE}/" "${GCS_FOLDER}" +gsutil -m rsync -R -x "__pycache__/.*" "${MODULE}/" "${GCS_FOLDER}" echo "Pushed ${MODULE}/ to ${GCS_FOLDER}." -