forked from biroc/courses-intro-to-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
requirements.sh
38 lines (31 loc) · 1.27 KB
/
requirements.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
29
30
31
32
33
34
35
36
37
38
BASE_DIR=$(pwd)
#NYCBIKES_DATA="https://assets.datacamp.com/course/sql/nycbikes15.zip"
#NYCBIKES_REPO="https://assets.datacamp.com/course/tmp_fixme_filip/nycbikes15_db_scripts.zip"
FILMS_REPO="https://assets.datacamp.com/course/tmp_fixme_filip/films.zip"
apt-get update && apt-get install -y unzip
# get repos
#wget $NYCBIKES_REPO
#unzip nycbikes15_db_scripts.zip
mkdir -p courses-intro-to-sql/data
wget $FILMS_REPO
unzip films.zip -d courses-intro-to-sql/data
#git clone https://$GITHUB_TOKEN@github.com/datacamp/courses-intro-to-sql.git
#git clone https://$GITHUB_TOKEN@github.com/datacamp/nycbikes15.git
# get data for nycbikes15
#wget $NYCBIKES_DATA
#unzip nycbikes15.zip -d ./nycbikes15/data
# build databases
#service postgresql start \
#&& sudo -u postgres createdb -O repl films \
#&& sudo -u postgres createdb -O repl nycbikes15 \
#&& cd courses-intro-to-sql \
#&& sudo -u postgres psql films < data/films/films.sql \
#&& cd $BASE_DIR/nycbikes15 \
#&& sudo -u postgres psql nycbikes15 < sql-setup/create-db-postgres.sql \
#&& service postgresql stop
pip3 install sqlwhat-ext==0.0.1
service postgresql start \
&& sudo -u postgres createdb -O repl films \
&& cd courses-intro-to-sql \
&& sudo -u postgres psql films < data/films/films.sql \
&& service postgresql stop