-
Notifications
You must be signed in to change notification settings - Fork 104
/
bqetl
executable file
·39 lines (31 loc) · 951 Bytes
/
bqetl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
# Absolute path this script is in
SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd )"
CMD=$1
if [ "$PWD" != "$SCRIPT_PATH" ]; then
echo "Please run this command from the root of your bigquery-etl checkout ($SCRIPT_PATH)"
exit 1
fi
if ! command -v python3 &> /dev/null; then
echo "Please install python (version 3.8 or greater)"
exit 1
fi
if [ "$CMD" == "bootstrap" ]; then
if [ -d "venv" ]; then
echo 'venv subdirectory already exists, execute "rm -rf venv" and re-run this command if you want to recreate it'
exit 1
else
python3 -m venv venv
fi
venv/bin/pip install --no-deps -r requirements.txt
venv/bin/pip install -e .
echo "bqetl configured! It should now be ready for use."
export BIGEYE_API_CRED_FILE='bigeye_credentials.ini'
exit 0
fi
if [ ! -d "venv" ]; then
echo "Please run ./bqetl bootstrap"
exit 1
fi
venv/bin/bqetl "$@"