Skip to content

Commit

Permalink
Corrected run_audit.sh to change directory before executing python sc…
Browse files Browse the repository at this point in the history
…ripts.
  • Loading branch information
t_watts committed Dec 1, 2020
1 parent 7893f6a commit 705b74e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions run_audit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
# get the current directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

cd $DIR

# table URI in project:dataset.table format
TABLE="<project>:<dataset>.<table>"

# remove previous run data files
rm "$DIR/folders.json" "$DIR/projects.json" "$DIR/owners_nldj.json"
rm folders.json projects.json owners_nldj.json

# run the audit files
python3 "$DIR/get_folders.py"
python3 "$DIR/get_projects.py"
python3 "$DIR/owner_report.py"
python3 get_folders.py
python3 get_projects.py
python3 owner_report.py

# load into BQ table
bq load --source_format=NEWLINE_DELIMITED_JSON $TABLE "$DIR/owners_nldj.json" "$DIR/schema.json"
bq load --source_format=NEWLINE_DELIMITED_JSON "$TABLE" owners_nldj.json schema.json

0 comments on commit 705b74e

Please sign in to comment.