-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
48 lines (37 loc) · 1.35 KB
/
init.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
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
ENV_FILE=".env"
NEW_UID=$(id -u)
if [ -f "$ENV_FILE" ]; then
sed -i '' '/^AIRFLOW_UID=/d' "$ENV_FILE"
echo "AIRFLOW_UID=$NEW_UID" >> "$ENV_FILE"
else
echo "AIRFLOW_UID=$NEW_UID" > "$ENV_FILE"
fi
if [ -f hiveconf/hiveserver2.pid ]; then
rm hiveconf/hiveserver2.pid
fi
if [ -d spark/data/checkpoint ]; then
rm -r spark/data/*
fi
pip install -q kaggle
kaggle datasets download -d ren294/ecommerce-clickstream-transactions && \
unzip ecommerce-clickstream-transactions.zip -d ecommerce-clickstream-transactions && \
mkdir -p nifi/data && \
mv ecommerce-clickstream-transactions/* nifi/data/ && \
rm -rf ecommerce-clickstream-transactions.zip ecommerce-clickstream-transactions
kaggle datasets download -d ren294/access-log-ecommerce && \
unzip access-log-ecommerce.zip -d access-log-ecommerce && \
mkdir -p nifi/data && \
mv access-log-ecommerce/* nifi/data/ && \
rm -rf access-log-ecommerce.zip access-log-ecommerce
kaggle datasets download -d ren294/ecom-postgres && \
unzip ecom-postgres.zip -d ecom-postgres && \
mkdir -p postgresDB/backup && \
mv ecom-postgres/* postgresDB/backup/ && \
rm -rf ecom-postgres.zip ecom-postgres
echo "AIRFLOW_PROJ_DIR=./airflow
_AIRFLOW_WWW_USER_USERNAME=ren294
_AIRFLOW_WWW_USER_PASSWORD=ren294
AIRFLOW_IMAGE_NAME=nghia294/ariflow-pro:v1.0
POSTGRES_LOCAL_PATH=packages/postgresql.jar
ELASTIC_PASSWORD=ren294" >> .env