-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathpsql.sh
executable file
·25 lines (25 loc) · 1.31 KB
/
psql.sh
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
#!/bin/bash
set -o pipefail
function finish {
sync_unlock.sh
}
if [ -z "$TRAP" ]
then
sync_lock.sh || exit -1
trap finish EXIT
export TRAP=1
fi
> errors.txt
> run.log
GHA2DB_PROJECT=carvel PG_DB=carvel GHA2DB_LOCAL=1 structure 2>>errors.txt | tee -a run.log || exit 1
./devel/db.sh psql carvel -c "create extension if not exists pgcrypto" || exit 1
./devel/db.sh psql carvel -c "create extension if not exists hll" || exit 1
GHA2DB_PROJECT=carvel PG_DB=carvel GHA2DB_LOCAL=1 gha2db 2019-03-15 0 today now 'regexp:(?i)^(vmware-tanzu\/.*carvel.*|k14s\/.*|carvel-dev\/.*)$' 2>>errors.txt | tee -a run.log || exit 2
GHA2DB_PROJECT=carvel PG_DB=carvel GHA2DB_LOCAL=1 GHA2DB_MGETC=y GHA2DB_SKIPTABLE=1 GHA2DB_INDEX=1 structure 2>>errors.txt | tee -a run.log || exit 3
GHA2DB_PROJECT=carvel PG_DB=carvel ./shared/setup_repo_groups.sh 2>>errors.txt | tee -a run.log || exit 4
GHA2DB_PROJECT=carvel PG_DB=carvel ./shared/import_affs.sh 2>>errors.txt | tee -a run.log || exit 5
GHA2DB_PROJECT=carvel PG_DB=carvel ./shared/setup_scripts.sh 2>>errors.txt | tee -a run.log || exit 6
GHA2DB_PROJECT=carvel PG_DB=carvel ./shared/get_repos.sh 2>>errors.txt | tee -a run.log || exit 7
GHA2DB_PROJECT=carvel PG_DB=carvel GHA2DB_LOCAL=1 vars || exit 8
./devel/ro_user_grants.sh carvel || exit 9
./devel/psql_user_grants.sh devstats_team carvel || exit 10