From 1391a5ea3b9aa31abdbf3781f3346791cee72529 Mon Sep 17 00:00:00 2001 From: Soriba SYLLA Date: Mon, 4 May 2026 09:58:34 +0000 Subject: [PATCH 1/3] Derniere modification du Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c1a3594..e481701 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,6 @@ pipeline when { branch 'main' } steps { sh ''' - echo $SUDO_PASSWORD cd /jenkins_test/sirh echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /jenkins_test/sirh git pull origin main -- 2.49.1 From 9951719b263f1cebfb1f55c7a0c6af0451fe7f7b Mon Sep 17 00:00:00 2001 From: Soriba SYLLA Date: Mon, 4 May 2026 12:22:15 +0000 Subject: [PATCH 2/3] Config env --- .gitignore | 4 +++- Jenkinsfile | 4 ++-- SIRH/settings.py | 41 +++++++++++++++++++++-------------------- requirements.txt | 1 + 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 10a233e..071058a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ db.sqlite3 venv/* -media/* \ No newline at end of file +media/* +*.pyc +__pycache__/ \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index e481701..9272e6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,8 +22,8 @@ pipeline when { branch 'main' } steps { sh ''' - cd /jenkins_test/sirh - echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /jenkins_test/sirh + cd /var/www/sirh + echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /var/www/sirh git pull origin main python3 -m venv venv . venv/bin/activate diff --git a/SIRH/settings.py b/SIRH/settings.py index a2267cb..ed7ef78 100644 --- a/SIRH/settings.py +++ b/SIRH/settings.py @@ -12,21 +12,21 @@ https://docs.djangoproject.com/en/5.2/ref/settings/ import os from pathlib import Path +from decouple import config # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent - # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure--wdb9t(77rvyac$_q!n5gw86&0r(0&&j171v9h!-_$jahsza*5' +SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = config('DEBUG', default=False, cast=bool) -ALLOWED_HOSTS = ["https://support.cerfig.org", "support.cerfig.org"] +ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]).split(',') # Application definition @@ -79,24 +79,25 @@ WSGI_APPLICATION = 'SIRH.wsgi.application' # Database # https://docs.djangoproject.com/en/5.2/ref/settings/#databases -# DATABASES = { -# 'default': { -# 'ENGINE': 'django.db.backends.mysql', -# 'NAME': 'sirh', -# 'USER': 'sirh', -# 'PASSWORD': 'sirh-cerfig', -# 'HOST': 'localhost', -# 'PORT': '3306', -# } -# } -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), +if config('ENVIRONMENT') == 'local': + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } + } +else: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': config('DATABASE_NAME'), + 'USER': config('DATABASE_USER'), + 'PASSWORD': config('DATABASE_PASSWORD'), + 'HOST': config('DATABASE_HOST'), + 'PORT': config('DATABASE_PORT'), + } } -} - # Password validation # https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators diff --git a/requirements.txt b/requirements.txt index b086c4d..5dff1b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,3 +17,4 @@ sqlparse==0.5.5 typing_extensions==4.15.0 tzdata==2026.2 urllib3==2.6.3 +python-decouple -- 2.49.1 From ecdaa9f9f9f97e31a8fd2a1be7e9dce126c23736 Mon Sep 17 00:00:00 2001 From: Soriba SYLLA Date: Mon, 4 May 2026 12:38:33 +0000 Subject: [PATCH 3/3] Config des environnement --- .gitignore | 4 +--- gestion_employe/models.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 071058a..10a233e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ db.sqlite3 venv/* -media/* -*.pyc -__pycache__/ \ No newline at end of file +media/* \ No newline at end of file diff --git a/gestion_employe/models.py b/gestion_employe/models.py index d736015..2570d6f 100644 --- a/gestion_employe/models.py +++ b/gestion_employe/models.py @@ -15,6 +15,7 @@ class Employe(models.Model): FONCTION_LISTE = [ ('directeur', 'Directeur'), ('assistant_direction', 'Assistante de direction'), + ('assistant_technique_recherche', 'Assistant technique de recherche'), ('comptable', 'Comptable'), ('raf', 'RAF'), ('data_manager', 'Data Manager'), -- 2.49.1