Modified SECRET_KEY for Jenkins
This commit is contained in:
parent
158376aa61
commit
96f58127b2
6
expenses_manager/Jenkinsfile
vendored
6
expenses_manager/Jenkinsfile
vendored
@ -2,6 +2,7 @@ pipeline{
|
|||||||
agent any
|
agent any
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
|
DJANGO_SECRET_KEY = 'test-secret-key-for-ci'
|
||||||
DJANGO_SETTINGS_MODULE = "expenses_manager.settings"
|
DJANGO_SETTINGS_MODULE = "expenses_manager.settings"
|
||||||
PYTHONUNBUFFERED = "1"
|
PYTHONUNBUFFERED = "1"
|
||||||
}
|
}
|
||||||
@ -29,9 +30,10 @@ pipeline{
|
|||||||
stage('Run tests') {
|
stage('Run tests') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
. venv/bin/activate
|
|
||||||
cd expenses_manager
|
cd expenses_manager
|
||||||
ls
|
|
||||||
|
. venv/bin/activate
|
||||||
|
export SECRET_KEY=$DJANGO_SECRET_KEY
|
||||||
venv/bin/pytest --cov
|
venv/bin/pytest --cov
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = os.getenv("DEBUG") == "True"
|
DEBUG = os.getenv("DEBUG") == "True"
|
||||||
|
|
||||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
SECRET_KEY = os.environ.get('SECRET_KEY', 'fallback-secret-key-for-dev')
|
||||||
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user