forked from Lizhmq/etcr-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crawl.sh
executable file
·28 lines (25 loc) · 953 Bytes
/
crawl.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
26
27
28
#!/bin/bash
userr=rebels
# token=$token
logdir=logs
propfile=$userr.properties
# repos=(
# oracle/graal
# )
set -f # avoid globbing (expansion of *).
repos=(${repositories//,/ })
# = ',' read -ra ARRAY <<< "$repositories"
mkdir $logdir/$userr
for repo in "${repos[@]}"
do
echo "spring.main.web-application-type=none" > $propfile
echo "scraping.repository=$repo" >> $propfile
echo "scraping.auth=token $token" >> $propfile
echo "scraping.export.all=false" >> $propfile
echo "scraping.export.classified=false" >> $propfile
echo "spring.jpa.hibernate.ddl-auto=update" >> $propfile
echo "spring.datasource.url=jdbc:postgresql://$db_host:$db_port/$repo" >> $propfile
echo "spring.datasource.username=$db_user">> $propfile
echo "spring.datasource.password=$db_pass" >> $propfile
java -jar build/libs/prscraper-1.0.1.jar --spring.config.location=$propfile #> $logdir/$userr/${repo/\//-}.txt
done