-
Notifications
You must be signed in to change notification settings - Fork 4
/
build_db_all
73 lines (58 loc) · 2.35 KB
/
build_db_all
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
65
66
67
68
69
70
71
72
#!/bin/bash
if [[ -z $1 || -z $2 ]]
then
echo Please run with via the following: $0 postgres_host postgres_user
exit
fi
echo "Starting Alliancemine DB Build: Host: $1 User: $2"
date
fasta_sources=(alliance-wb-fasta alliance-fb-fasta alliance-zfin-fasta alliance-mgi-fasta alliance-rgd-fasta)
ontology_sources=(do go eco mmo emapa zfa wbbt fbbt so psi-mi-ontology go-slim)
sgd_sources=(sgd sgd-gff sgd-gff-utr sgd-db-utr fungi-homologs cgob-homologs cglabrata-homologs pombe-homologs homolog-genes sgd-complementation-db sgd-complexes sgd-protein-properties sgd-protein-ntermini)
alliance_sources=(alliance-genes go-annotation alliance-disease alliance-orthologs alliance-alleles alliance-expression entrez-organism)
postprocess_sources=(create-references do-sources transfer-sequences create-attribute-indexes summarise-objectstore)
solr_indexes=(create-autocomplete-index create-search-index)
echo createdb -U $2 -h $1 alliancemine || true
createdb -U $2 -h $1 alliancemine || true
echo createdb -U $2 -h $1 items-alliancemine || true
createdb -U $2 -h $1 items-alliancemine || true
echo ./gradlew --no-daemon builddb
./gradlew --no-daemon builddb
date
for i in "${fasta_sources[@]}"
do
echo "./gradlew --no-daemon integrate -Psource=$i"
./gradlew --no-daemon --stacktrace integrate -Psource=$i
date
done
for i in "${ontology_sources[@]}"
do
echo "./gradlew --no-daemon integrate -Psource=$i"
./gradlew --no-daemon --stacktrace integrate -Psource=$i
date
done
for i in "${sgd_sources[@]}"
do
echo "./gradlew --no-daemon integrate -Psource=$i"
./gradlew --no-daemon --stacktrace integrate -Psource=$i
date
done
for i in "${alliance_sources[@]}"
do
echo "./gradlew --no-daemon integrate -Psource=$i"
./gradlew --no-daemon --stacktrace integrate -Psource=$i
date
done
for i in "${postprocess_sources[@]}"
do
echo "./gradlew --no-daemon postprocess -Pprocess=$i"
./gradlew --no-daemon --stacktrace postprocess -Pprocess=$i
date
done
echo pg_dump -F c -U $2 -h $1 -f /root/data/alliancemine.dump alliancemine
pg_dump -F c -U $2 -h $1 -f /root/data/alliancemine.dump alliancemine
date
echo "Backup DB File to S3: aws s3 cp /root/data/alliancemine.dump s3://agr-db-backups/alliancemine/stage/`date "+%Y-%m-%d_%H:%M:%S".dump`"
aws s3 cp /root/data/alliancemine.dump s3://agr-db-backups/alliancemine/stage/`date "+%Y-%m-%d_%H:%M:%S".dump`
echo "Finished Alliancemine DB Build"
date