forked from rtenorioh/Press-Ticket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UPDATE.sh
106 lines (74 loc) · 2.5 KB
/
UPDATE.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
echo ""
echo "██████╗ ██████╗ ███████╗███████╗███████╗ ████████╗██╗ ██████╗██╗ ██╗███████╗████████╗"
echo "██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝ ╚══██╔══╝██║██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝"
echo "██████╔╝██████╔╝█████╗ ███████╗███████╗ ██║ ██║██║ █████╔╝ █████╗ ██║ "
echo "██╔═══╝ ██╔══██╗██╔══╝ ╚════██║╚════██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██║ "
echo "██║ ██║ ██║███████╗███████║███████║ ██║ ██║╚██████╗██║ ██╗███████╗ ██║ "
echo "╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝ "
echo " "
echo "ATUALIZANDO PARA A VERSÃO MAIS RECENTE..."
echo " "
sleep 2
echo " "
echo "BAIXANDO AS ATUALIZAÇÕES"
echo " "
sleep 2
git reset --hard
git pull
echo " "
echo "ACESSANDO O BACKEND"
echo " "
sleep 2
cd backend
echo " "
echo "ATUALIZANDO OS ARQUIVOS DO BACKEND"
echo " "
sleep 2
sudo rm -rf node_modules
npm install
sudo rm -rf dist
npm run build
echo " "
echo "EXECUTANDO O DB:MIGRATE"
echo " "
sleep 2
npx sequelize db:migrate
echo " "
echo "EXECUTANDO O DB:SEED:ALL"
echo " "
sleep 2
npx sequelize db:seed:all
echo " "
echo "ACESSANDO O FRONTEND"
echo " "
sleep 2
cd ../frontend
sleep 2
echo " "
echo "VERIFICANDO O CONFIG.JSON"
echo " "
sleep 2
if [ ! -e src/config.json ]; then
echo "Criando o arquivo config.json"
cp src/config.json.example src/config.json
else
echo "O arquivo config.json já existe"
fi
sleep 2
echo " "
echo "ATUALIZANDO OS ARQUIVOS DO FRONTEND"
echo " "
sleep 2
sudo rm -rf node_modules
npm install
rm -rf build
npm run build
echo " "
echo "RESTART PM2"
echo " "
sleep 2
pm2 restart all
echo " "
echo "PRESS TICKET ATUALIZADO COM SUCESSO!!!"
echo " "