-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from filiperochalopes/develop
Develop - Primeira versão utilizável 22/05/2023
- Loading branch information
Showing
304 changed files
with
34,649 additions
and
10,757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
POSTGRES_DB="service_status" | ||
POSTGRES_NAME="hmlem" | ||
POSTGRES_USER="postgres" | ||
POSTGRES_PASSWORD="kd&njf%s7@nme$7" | ||
POSTGRES_PASS="7xyed8uDyi0=" | ||
POSTGRES_PORT=55432 | ||
POSTGRES_TEST_PORT=55433 | ||
FLASKAPP_PORT=5006 | ||
APP_PORT=83 | ||
FRONTEND_PORT=3002 | ||
SECRET_KEY="40da743e52d28395796361da56614621fd4b59cd1338dd4587918fb6d8e18106" | ||
MASTER_KEY="passw@rd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
POSTGRES_DB="service_status" | ||
POSTGRES_NAME="hmlem" | ||
POSTGRES_USER="postgres" | ||
POSTGRES_PASSWORD="kd&njf%s7@nme$7" | ||
# openssl rand -base64 8 | ||
POSTGRES_PASS="7xyed8uDyi0=" | ||
POSTGRES_PORT=55432 | ||
# Porta que executa o banco de dados de teste | ||
POSTGRES_TEST_PORT=55433 | ||
FLASKAPP_PORT=5006 | ||
APP_PORT=83 | ||
FRONTEND_PORT=3002 | ||
|
||
# Gerar hash aleatório para criptografia | ||
# python -c 'import secrets; print(secrets.token_hex())' | ||
SECRET_KEY= | ||
|
||
# Gerar senha aleatória | ||
MASTER_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
__pycache__ | ||
.env | ||
data | ||
.idea | ||
flaskapp/app/graphql/mutations/pdfs/tests/pdfs_created_files_test/* | ||
instance/ | ||
*.db | ||
flaskapp/app/tests/files/tmp/*.pdf | ||
data | ||
.DS_Store | ||
.pytest_cache | ||
users.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
cd ./reactapp | ||
npx pretty-quick --staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
cd ./reactapp | ||
npx prettier --write src/**/*.{js,jsx} && npx eslint src/**/*.{js,jsx} --fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
cd ./reactapp | ||
|
||
exec < /dev/tty && yarn commit --edit --hook || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,42 @@ | ||
build: | ||
docker-compose build --no-cache | ||
run: | ||
docker-compose up --build | ||
docker compose up --build | ||
logs: | ||
docker-compose logs -f | ||
docker compose logs -f | ||
seed: | ||
docker exec -it evolucao_hospitalar_flaskapp bash -c "FLASK_APP=app/__init__.py && \ | ||
docker exec -it evolucao_hospitalar_app bash -c "FLASK_APP=app/__init__.py && \ | ||
flask seed" | ||
users: | ||
docker exec -it evolucao_hospitalar_app bash -c "FLASK_APP=app/__init__.py && \ | ||
flask create_users" | ||
terminal: | ||
docker exec -it evolucao_hospitalar_flaskapp bash | ||
docker exec -it evolucao_hospitalar_app bash | ||
shell: | ||
docker exec -it evolucao_hospitalar_flaskapp bash -c "flask shell" | ||
docker exec -it evolucao_hospitalar_app bash -c "flask shell" | ||
migrate: | ||
docker exec -it evolucao_hospitalar_flaskapp bash -c "flask db upgrade" | ||
docker exec -it evolucao_hospitalar_app bash -c ' \ | ||
chmod -R 777 /app/migrations && \ | ||
flask db upgrade' | ||
makemigrations: | ||
docker exec -it evolucao_hospitalar_flaskapp bash -c 'flask db migrate -m "$(m)"' | ||
reset_db: | ||
docker exec -it evolucao_hospitalar_flaskapp bash -c ' \ | ||
rm -rf migrations && \ | ||
rm -rf instance && \ | ||
flask db init && \ | ||
flask db migrate -m "Initial migration" && \ | ||
flask db upgrade' | ||
docker exec -it evolucao_hospitalar_app bash -c ' \ | ||
chmod -R 777 /app/migrations && \ | ||
flask db migrate -m "$(m)"' | ||
test_all: | ||
docker exec -it evolucao_hospitalar_app bash -c 'pytest -s' | ||
clean_db: | ||
docker compose rm -s -v -f db | ||
sudo rm -rf data | ||
docker compose up -d db | ||
sleep 10 | ||
docker exec -it evolucao_hospitalar_app bash -c ' \ | ||
flask db upgrade' | ||
test_flow: | ||
# Clean all database | ||
docker exec -it evolucao_hospitalar_db bash -c 'psql -U postgres -c "\set AUTOCOMMIT on" -c "DROP DATABASE hmlem WITH (FORCE)" -c "CREATE DATABASE hmlem"' | ||
docker exec -it evolucao_hospitalar_app bash -c 'flask db upgrade && flask seed' | ||
docker exec -it evolucao_hospitalar_app bash -c 'pytest -s -k TestInternmentFlow' | ||
docker exec -it evolucao_hospitalar_app bash -c 'pytest -s -k TestPrintPdfs' | ||
fix-folder-permission: | ||
docker exec -it evolucao_hospitalar_app bash -c ' \ | ||
chmod -R 777 /app/migrations' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: "3" | ||
services: | ||
db: | ||
container_name: evolucao_hospitalar_db | ||
restart: always | ||
image: postgres:13.9-alpine | ||
volumes: | ||
- ./data:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_DB=${POSTGRES_NAME} | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASS} | ||
ports: | ||
- "${POSTGRES_PORT}:5432" | ||
app: | ||
container_name: evolucao_hospitalar_app | ||
restart: always | ||
build: | ||
context: ./flaskapp | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ./flaskapp:/app | ||
environment: | ||
- SECRET_KEY=${SECRET_KEY} | ||
- MASTER_KEY=${MASTER_KEY} | ||
- POSTGRES_NAME=${POSTGRES_NAME:?nome do BD ausente} | ||
- POSTGRES_USER=${POSTGRES_USER:?usuario do BD ausente} | ||
- POSTGRES_PASS=${POSTGRES_PASS:?senha do BD ausente} | ||
ports: | ||
- "${FLASKAPP_PORT}:5000" | ||
depends_on: | ||
- db | ||
nginx: | ||
container_name: evolucao_hospitalar_nginx | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.nginx | ||
volumes: | ||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf | ||
ports: | ||
- "${APP_PORT}:80" | ||
depends_on: | ||
- app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.