-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
156 changed files
with
41,175 additions
and
11,604 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
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,20 @@ | ||
# test compose setup | ||
name: Bayanat tests | ||
on: [push] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
docker: | ||
image: docker:latest | ||
options: --privileged | ||
ports: | ||
- 80:80 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Create .env file | ||
run: | | ||
./gen-env.sh -d -e .env.test | ||
- name: Bayanat Tests | ||
run: docker compose -f docker-compose-prebuilt-test.yml --env-file .env.test up --build --exit-code-from bayanat |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ flask_session | |
.mypy_cache/ | ||
.history | ||
celerybeat-schedule.db | ||
.env | ||
.env* | ||
enferno/media/* | ||
*.log | ||
*.csv | ||
|
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
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
-r requirements.txt | ||
pytest==7.4.4 | ||
pydantic==1.10.13 | ||
flask_pydantic==0.11.0 | ||
SQLAlchemy-Utils==0.41.1 | ||
pre-commit==3.5.0 | ||
black==23.11.0 | ||
factory-boy==3.3.0 |
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,61 @@ | ||
version: '3' | ||
|
||
services: | ||
postgres: | ||
container_name: postgres | ||
image: 'postgis/postgis:15-3.3' | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
volumes: | ||
- 'postgres_dev_data:/var/lib/postgresql/data' | ||
expose: | ||
- '5432' | ||
healthcheck: | ||
test: "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}" | ||
interval: 3s | ||
retries: 10 | ||
|
||
redis: | ||
container_name: redis | ||
image: 'redis:latest' | ||
expose: | ||
- '6379' | ||
command: redis-server --requirepass '${REDIS_PASSWORD}' | ||
volumes: | ||
- 'redis_dev_data:/var/lib/redis/data:rw' | ||
healthcheck: | ||
test: [ "CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD}", "ping" ] | ||
interval: 3s | ||
retries: 10 | ||
|
||
bayanat: | ||
container_name: bayanat | ||
image: bayanat/bayanat:dev | ||
build: | ||
context: . | ||
dockerfile: ./flask/Dockerfile.dev | ||
args: | ||
- ROLE=flask | ||
- ENV_FILE=${ENV_FILE:-.env.dev} | ||
volumes: | ||
- 'bayanat_dev_media:/app/enferno/media/:rw' | ||
- 'bayanat_dev_imports:/app/enferno/imports:rw' | ||
- '${PWD}/config.json:/app/config.json:rw' | ||
- '${PWD}/reload.ini:/app/reload.ini:rw' | ||
- '${PWD}/${ENV_FILE:-.env.dev}:/app/.env:ro' | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
redis: | ||
condition: service_healthy | ||
ports: | ||
- '127.0.0.1:5000:5000' | ||
restart: always | ||
|
||
volumes: | ||
redis_dev_data: | ||
postgres_dev_data: | ||
bayanat_dev_media: | ||
bayanat_dev_imports: |
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,68 @@ | ||
version: '3' | ||
|
||
services: | ||
postgres: | ||
container_name: postgres | ||
image: 'postgis/postgis:15-3.3' | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
volumes: | ||
- 'postgres_dev_data:/var/lib/postgresql/data:rw' | ||
expose: | ||
- '5432' | ||
read_only: true | ||
security_opt: | ||
- no-new-privileges:true | ||
tmpfs: | ||
- /var/run/postgresql | ||
healthcheck: | ||
test: "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}" | ||
interval: 3s | ||
retries: 10 | ||
|
||
redis: | ||
container_name: redis | ||
image: 'redis:latest' | ||
expose: | ||
- '6379' | ||
command: redis-server --requirepass '${REDIS_PASSWORD}' | ||
read_only: true | ||
security_opt: | ||
- no-new-privileges:true | ||
volumes: | ||
- 'redis_dev_data:/var/lib/redis/data:rw' | ||
healthcheck: | ||
test: [ "CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD}", "ping" ] | ||
interval: 3s | ||
retries: 10 | ||
|
||
bayanat: | ||
container_name: bayanat | ||
image: 'bayanat/bayanat:dev' | ||
volumes: | ||
- 'bayanat_dev_media:/app/enferno/media:rw' | ||
- 'bayanat_dev_imports:/app/enferno/imports:rw' | ||
- '${PWD}/config.json:/app/config.json:rw' | ||
- '${PWD}/reload.ini:/app/reload.ini:rw' | ||
- '${PWD}/${ENV_FILE:-.env.dev}:/app/.env:ro' | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
redis: | ||
condition: service_healthy | ||
read_only: true | ||
tmpfs: | ||
- /tmp | ||
security_opt: | ||
- no-new-privileges:true | ||
ports: | ||
- '127.0.0.1:5000:5000' | ||
restart: always | ||
|
||
volumes: | ||
redis_dev_data: | ||
postgres_dev_data: | ||
bayanat_dev_media: | ||
bayanat_dev_imports: |
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,63 @@ | ||
version: '3' | ||
|
||
services: | ||
postgres: | ||
container_name: postgres | ||
image: 'postgis/postgis:15-3.3' | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_DB=bayanat_test | ||
volumes: | ||
- 'postgres_test_data:/var/lib/postgresql/data:rw' | ||
expose: | ||
- '5432' | ||
read_only: true | ||
security_opt: | ||
- no-new-privileges:true | ||
tmpfs: | ||
- /var/run/postgresql | ||
healthcheck: | ||
test: "pg_isready -d bayanat_test -U ${POSTGRES_USER}" | ||
interval: 3s | ||
retries: 10 | ||
|
||
redis: | ||
container_name: redis | ||
image: 'redis:latest' | ||
expose: | ||
- '6379' | ||
command: redis-server --requirepass '${REDIS_PASSWORD}' | ||
read_only: true | ||
security_opt: | ||
- no-new-privileges:true | ||
volumes: | ||
- 'redis_test_data:/var/lib/redis/data:rw' | ||
healthcheck: | ||
test: [ "CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD}", "ping" ] | ||
interval: 3s | ||
retries: 10 | ||
|
||
bayanat: | ||
container_name: bayanat | ||
build: | ||
context: . | ||
dockerfile: ./flask/Dockerfile.test | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
redis: | ||
condition: service_healthy | ||
ports: | ||
- '127.0.0.1:5000:5000' | ||
volumes: | ||
- '${PWD}/reload.ini:/app/reload.ini:rw' | ||
- '${PWD}/${ENV_FILE:-.env.test}:/app/.env:ro' | ||
- 'bayanat_test_media:/app/enferno/media:rw' | ||
- 'bayanat_test_imports:/app/enferno/imports:rw' | ||
|
||
volumes: | ||
redis_test_data: | ||
postgres_test_data: | ||
bayanat_test_media: | ||
bayanat_test_imports: |
Oops, something went wrong.