Skip to content

Commit

Permalink
Merge pull request #239 from openimis/release/24.04
Browse files Browse the repository at this point in the history
Release/24.04
  • Loading branch information
delcroip authored May 2, 2024
2 parents 53488ac + 81cdb12 commit 3ae6658
Show file tree
Hide file tree
Showing 33 changed files with 1,780 additions and 50,725 deletions.
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "BE Dev Container",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "cd openimis && python manage.py runserver",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"formulahendry.code-runner"
]
}
}

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
52 changes: 36 additions & 16 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
# Database engine, should be changed for mssql
DB_ENGINE=django.db.backends.postgresql
# Database host
DB_HOST=<host>
# Database port
DB_PORT=<port>
# Database name
DB_NAME=<db>
# Database username
DB_USER=<username>
# Database user password
DB_PASSWORD=<password>
# Database PSQL
PSQL_DB_USER=IMISuser
PSQL_DB_PASSWORD=IMISuser@1234
PSQL_DB_PORT=5432
PSQL_DB_ENGINE=django.db.backends.postgresql
PSQL_DB_HOST=127.0.0.1
PSQL_DB_NAME=test_imis
# Database MSSQL
MSSQL_DB_PORT=1433
MSSQL_DB_ENGINE=mssql
MSSQL_DB_USER=SA
MSSQL_DB_PASSWORD=IMISuser@1234
MSSQL_DB_NAME=test_imis
MSSQL_DB_HOST=127.0.0.1

DB_NAME=test_imis
DB_TEST_NAME=test_imis

# Site root that will prefix all exposed endpoints. It's required when working with openIMIS frontend
SITE_ROOT=api
# Should the debug be on (i.e. debug information will be displayed)
DEBUG=True
# Log level to be used. Remove for default.
DJANGO_LOG_LEVEL=WARNING
# Log handler to be used, reffer to openIMIS/openIMIS/settings.py. Remove for default.
DJANGO_LOG_HANDLER=debug-log
MODE=DEV
# this will also show the DB request in the console
DJANGO_DB_LOG_HANDLER=console
# Photo path root used in insuree module. Only used if InsureeConfig value not specified. Comment out for default.
PHOTO_ROOT_PATH=<photo path>
#PHOTO_ROOT_PATH=<photo path>
# Should the database be migrated before start (entrypoint.sh - docker setup). Will be migrated anyway if $SITE_ROOT=api. Comment out for False
DJANGO_MIGRATE=True
# Should the modules be searched for scheduled tasks. Comment out for false
# SCHEDULER_AUTOSTART=True
PROJECT_NAME=dev
NEW_OPENIMIS_HOST=dev-openimis.org
HTTP_PORT=80
HTTPS_PORT=443
DB_DEFAULT=PSQL
# Comment if you don't want to initialize with the demo dataset
INIT_MODE=demo
DB_BRANCH=develop
GW_BRANCH=develop
BE_BRANCH=develop
FE_BRANCH=develop



11 changes: 10 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ exclude =
.coverage,
openIMIS/wsgi.py,
dist,
openIMIS/migrations
openIMIS/migrations,
../**/migrations/*.py, # Relative paths for other modules
../**/.git,
../**/.gitignore,
../**/*.pot,
../**/*.py[co],
../**/__pycache__,

ignore =
# At least two spaces before inline comment.
Expand All @@ -19,5 +25,8 @@ ignore =
E303,
# Ambiguous variable name.
E741,
# Unused imports - sometimes required in modular version, fixes in __init__.py may break builds
# Ideally added for every __init__ file manually but for the time it's added globally
F401

max-line-length = 120
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Sonar CI pipeline
on:
push:
branches:
- main
- 'release/**'
- develop
- 'feature/**'
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
16 changes: 10 additions & 6 deletions .github/workflows/ci_assembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.10"

- name: Cache dependencies
uses: actions/cache@v2
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
run: |
export DB_NAME_TEST="test_$DB_NAME"
if [ ${GITHUB_REF##*/} = "develop" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
if [ ${GITHUB_REF##*/} = "main" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
echo "Branch ${GITHUB_REF##*/}, usign ${DBBRANCH} branch for database"
git clone --depth=1 --branch=$DBBRANCH https://github.com/openimis/database_postgresql.git ./sql_psql
Expand All @@ -108,7 +108,7 @@ jobs:
run: |
export DB_NAME_TEST="test_$DB_NAME"
if [ ${GITHUB_REF##*/} = "develop" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
if [ ${GITHUB_REF##*/} = "main" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
echo "Branch ${GITHUB_REF##*/}, usign ${DBBRANCH} branch for database"
git clone --depth=1 --branch=$DBBRANCH https://github.com/openimis/database_ms_sqlserver.git ./sql_mssql
cd sql_mssql/ && bash concatenate_files.sh && cd ..
Expand Down Expand Up @@ -139,11 +139,12 @@ jobs:
run: |
python -V
export MODULES=$(jq -r '(.modules[].name)' ../openimis.json | xargs)
MODULES=$(echo "$MODULES" | sed -E "s/\b$(echo "${CI_EXCLUDED_MODULE// /\\b|\\b}")\b/ /g" | xargs)
echo $MODULES
python manage.py test --keepdb $MODULES
env:
SECRET_KEY: secret
DEBUG: true
MODE: DEV
DB_ENGINE: django.db.backends.postgresql
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
Expand All @@ -153,6 +154,7 @@ jobs:
DB_PASSWORD: GitHub999
#DEV_SERVER: true
SITE_ROOT: api
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}

- name: Django tests MSSQL
working-directory: ./openIMIS
Expand All @@ -161,11 +163,12 @@ jobs:
run: |
python -V
export MODULES=$(jq -r '(.modules[].name)' ../openimis.json | xargs)
MODULES=$(echo "$MODULES" | sed -E "s/\b$(echo "${CI_EXCLUDED_MODULE// /\\b|\\b}")\b/ /g" | xargs)
echo $MODULES
python manage.py test --debug-mode --timing --keepdb $MODULES
env:
SECRET_KEY: secret
DEBUG: true
MODE: DEV
DB_ENGINE: mssql
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
Expand All @@ -176,3 +179,4 @@ jobs:
#DEV_SERVER: true
SITE_ROOT: api
#REMOTE_USER_AUTHENTICATION: False
CI_EXCLUDED_MODULE: ${{ vars.CI_EXCLUDED_MODULE }}
Loading

0 comments on commit 3ae6658

Please sign in to comment.