-
Notifications
You must be signed in to change notification settings - Fork 2
/
run
executable file
·64 lines (53 loc) · 1.41 KB
/
run
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
set -eo pipefail
if [ -f .env ]; then
# shellcheck disable=SC2002,SC2046
export $(cat .env | xargs)
fi
function setup {
poetry install
poetry run pre-commit install
}
function test {
local target="${1-"dbt-duckdb"}"
if [ -z "${GITHUB_ACTIONS}" ] && [ "${target}" = "dbt-postgres" ];
then
createdb "${POSTGRES_DB-"dbt_linreg"}" || true
fi
if [ -z "${GITHUB_ACTIONS}" ] && [ "${target}" = "dbt-duckdb" ];
then
rm -f dbt.duckdb
fi
poetry run python scripts.py gen-test-cases --skip-if-exists
poetry run dbt deps \
--project-dir ./integration_tests \
--profiles-dir ./integration_tests/profiles \
--target "${target}"
poetry run dbt seed \
--project-dir ./integration_tests \
--profiles-dir ./integration_tests/profiles \
--target "${target}"
poetry run dbt run \
--project-dir ./integration_tests \
--profiles-dir ./integration_tests/profiles \
--target "${target}" \
--selector "${target}-selector"
poetry run dbt test \
--project-dir ./integration_tests \
--profiles-dir ./integration_tests/profiles \
--target "${target}" \
--selector "${target}-selector"
}
function lint {
poetry run pre-commit run -a
}
function docs:deploy {
mkdocs gh-deploy -f docs/mkdocs.yml
}
function help {
echo "$0 <task> <args>"
echo "Tasks:"
compgen -A function | cat -n
}
TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"