Fix bugs and add run.sh (dev)

This commit is contained in:
Santiago Lo Coco 2023-10-23 15:52:13 -03:00
parent bed7b36b3a
commit ecea83c8b4
4 changed files with 48 additions and 8 deletions

View File

@ -1,10 +1,6 @@
# fids
## Contributing
```
pre-commit install
```
## Componentes
### auth-domain
@ -21,3 +17,24 @@ Contiene `flights-information` con su base de datos. Maneja todo lo relacionado
### screens-domain
PWA pensado para utilizarse en un aeropuerto. Se maneja con un solo `origin` y con el query param `lastUpdated` para pedir cambios. Esta tiene una base datos para cachear los resultados y poder funcionar offline.
## Uso
Primero, deberá configurar los `.env` como usted prefiera. Copie y modifique los ejemplos:
```
cp flights-domain/.env.prod.example flights-domain/.env.prod
cp user-domain/.env.prod.example user-domain/.env.prod
```
Luego, para levantar todos los componentes, basta con ejecutar:
```
./run.sh
```
## Contribuir
```
pre-commit install
```

View File

@ -7,6 +7,7 @@ const auth_instance = new Axios({
accept: "application/json",
"Content-Type": "application/json",
},
validateStatus: (x) => { return !(x < 200 || x > 204) }
});
const flights_instance = new Axios({
@ -15,6 +16,7 @@ const flights_instance = new Axios({
accept: "application/json",
"Content-Type": "application/json",
},
validateStatus: (x) => { return !(x < 200 || x > 204) }
});
auth_instance.interceptors.response.use(

View File

@ -14,9 +14,7 @@ export const useFetchZones = (origin: string | null) => {
.then((data) => {
setZones(data);
})
.catch((error) => {
setError(error as string);
});
.catch((error) => {});
}, []);
return { zones, error };

23
run.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
export USER_MANAGER=auth-domain/user-manager
docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t slococo/user-manager:prod
export FLIGHTS_INFORMATION=flights-domain/flights-information
docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t slococo/flights-information:prod
docker build screen-domain -f screen-domain/Dockerfile.prod -t slococo/screen-client:prod
docker build browser-domain -f browser-domain/Dockerfile.prod -t slococo/browser-client:prod
export API_IMAGE=slococo/flights-information:prod
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
export API_IMAGE=slococo/user-manager:prod
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
export CLIENT_IMAGE=slococo/screen-client:prod
docker compose -f screen-domain/docker-compose.yml up -d
export CLIENT_IMAGE=slococo/browser-client:prod
docker compose -f browser-domain/docker-compose.yml up -d