Skip to content

Commit 23a84c9

Browse files
committed
update Jenkinsfile
1 parent 95ec00c commit 23a84c9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Jenkinsfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,23 @@ password = pytition
1919
default-character-set = utf8
2020
ENDOFFILE
2121
22-
echo "Updating settings to use your my.cnf"
22+
echo "Generating a basic config file"
23+
24+
echo "from .base import *" > pytition/pytition/settings/config.py
25+
echo "SECRET_KEY = '$(python3 -c "from django.core.management.utils import get_random_secret_key as g; print(g())")'" >> pytition/pytition/settings/config.py
26+
cat <<EOT >> pytition/pytition/settings/config.py
27+
DATABASES = {
28+
'default': {
29+
'ENGINE': 'django.db.backends.mysql',
30+
'OPTIONS': {
31+
'read_default_file': '$PWD/my.cnf',
32+
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
33+
},
34+
}
35+
}
36+
EOT
2337
24-
sed -i -e "s@/home/petition/www/@$PWD/@" pytition/pytition/settings/base.py
38+
export DJANGO_SETTINGS_MODULE=pytition.settings.config
2539
2640
echo "Running database migrations"
2741

0 commit comments

Comments
 (0)