Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: adding a new script to allow loading qartod tests #74

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions qartod/load_all_csvs_into_postgres.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# To be run from qc-lookup/qartod directory.
# Modify the ~/host_repos/ directory below to
# Load database connection information from .env file.
# Values read in by the load_qartod.py script:
# POSTGRES_HOSTNAME
# POSTGRES_USERNAME
# POSTGRES_PASSWORD

if [ -f .env ]
then
export $(cat .env | xargs)
fi
#set to production DB info for release
the_host=localhost
the_user=awips

#Path where https://github.com/oceanobservatories/qc-lookup is cloned
qc_lookup_repo_path=~/host_repos/qc-lookup/qartod/

#Probably should be /opt/miniconda2/envs/engine/stream_engine/sripts/ for release
stream_engine_path=~/host_repos/stream_engine/scripts/

for i in $(find . -mindepth 1 -type d \( -path ./velpt -o -name climatology_tables \) -prune -o -type d -print); do
echo "Processing QARTOD tests in $i";
cd "$i"
find . -type d -name climatology_tables -prune -o -type f -name "*.csv" -print -exec python ${stream_engine_path}load_qartod.py {} \;
cd ..
done

# find $qc_lookup_repo_path -type d -name climatology_tables -prune -o -type f -name "*.csv" -print -exec python ${stream_engine_path}load_qartod.py {} \;