Skip to content

Commit

Permalink
Correções e script de atualização
Browse files Browse the repository at this point in the history
  • Loading branch information
rtenorioh committed Aug 8, 2022
1 parent bcf255b commit d67a798
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 34 deletions.
18 changes: 0 additions & 18 deletions .env.example

This file was deleted.

73 changes: 73 additions & 0 deletions UPDATE.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash
echo " "
echo "ATUALIZANDO PARA A VERSÃO MAIS RECENTE DO PRESS TICKET!"
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 MIGRATE E SEED"
echo " "

sleep 2

npx sequelize db:migrate
npx sequelize db:seed

echo " "
echo "ACESSANDO O FRONTEND"
echo " "

sleep 2

cd ../frontend

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 " "
28 changes: 16 additions & 12 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
NODE_ENV=
BACKEND_URL=http://localhost
FRONTEND_URL=http://localhost:3000
PROXY_PORT=8080
PORT=8080
NODE_ENV=
BACKEND_URL=http://localhost
FRONTEND_URL=http://localhost:3000
PORT=8080
PROXY_PORT=8080
CHROME_BIN=C:\Program Files\Google\Chrome\Application\chrome.exe

DB_DIALECT=
DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=
DB_DIALECT=mysql
DB_HOST=localhost
DB_USER=root
DB_PASS=
DB_NAME=pressticket

JWT_SECRET=
JWT_REFRESH_SECRET=
USER_LIMIT=3
CONNECTIONS_LIMIT=1

JWT_SECRET=5g1yk7pD9q3YL0iBEuUlPwOiWLj3I5tK+/rhHm+jgdE=
JWT_REFRESH_SECRET=F2c8gag5nvqQkBOmOu5dWkK+gqZnjPUzHmx7S2tWkvs=
22 changes: 21 additions & 1 deletion docs/INSTALL_VPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
```CREATE DATABASE pressticket CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;```

8. Acessar o BD do mysql

```USE mysql;```

9. Trocar plugin de autenticação no mysql
Expand Down Expand Up @@ -186,7 +187,10 @@ JWT_REFRESH_SECRET=

```nano .env```

45. ```REACT_APP_BACKEND_URL=https://back.pressticket.com.br```
45.
```REACT_APP_BACKEND_URL=https://back.pressticket.com.br```
```REACT_APP_HOURS_CLOSE_TICKETS_AUTO=```
```SERVER_PORT=3333```

46. Buildando o frontend

Expand Down Expand Up @@ -312,6 +316,22 @@ server {

```sudo certbot --nginx```

71. Acessando diretório raiz

```cd ~```

72. Acessando a pasta do sistema

```cd Press-Ticket/```

73. Preparar o arquivo de update

```chmod +x UPDATE.sh```

74. Para executar a atualização

```./UPDATE.sh```

==============================================================

### Usuário padrão para acesso
Expand Down
6 changes: 3 additions & 3 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_BACKEND_URL = http://localhost:8080/
REACT_APP_HOURS_CLOSE_TICKETS_AUTO =
SERVER_PORT = 3333
REACT_APP_BACKEND_URL=http://localhost:8080
REACT_APP_HOURS_CLOSE_TICKETS_AUTO=
SERVER_PORT=3333

0 comments on commit d67a798

Please sign in to comment.