Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
gcp-gce-project-audit-bq/run_audit.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20 lines (14 sloc)
484 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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 folders.json projects.json owners_nldj.json | |
# run the audit files | |
python3 get_folders.py | |
python3 get_projects.py | |
python3 owner_report.py | |
# load into BQ table | |
bq load --source_format=NEWLINE_DELIMITED_JSON "$TABLE" owners_nldj.json schema.json |