-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·42 lines (37 loc) · 880 Bytes
/
deploy.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
#!/bin/bash
data="data.json"
read -p "Inserisci un messaggio di commit: " message
comman_operations() {
cp "$data" ./app/src/ # Copia in una sottodirectory della directory corrente
cp "$data" ./dashboard/src/ # Copia in una sottodirectory della directory corrente
cd ./app
npm run build
cd ..
cd ./dashboard
npm run build
cd ..
firebase deploy --only hosting
}
if [[ "$1" == "--app" ]]; then
# Only app
cp "$data" ./app/src/
cd ./app
npm run build
cd ..
firebase deploy --only hosting:app
elif [[ "$1" == "--dashboard" ]]; then
# Only dashboard
cp "$data" ./dashboard/src/
cd ./dashboard
npm run build
cd ..
firebase deploy --only hosting:dashboard
else
# both
comman_operations
fi
# Upload on github
git add .
git commit -m "$message"
git push
echo "Deploy completed succesfully!"