Skip to content

Commit ddc5157

Browse files
committed
update Jenkinsfile
1 parent 95ec00c commit ddc5157

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

Jenkinsfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,22 @@ 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 "SECRET_KEY = '$(python3 -c "from django.core.management.utils import get_random_secret_key as g; print(g())")'" > pytition/pytition/settings/config.py
25+
cat <<EOT >> pytition/pytition/settings/config.py
26+
DATABASES = {
27+
'default': {
28+
'ENGINE': 'django.db.backends.mysql',
29+
'OPTIONS': {
30+
'read_default_file': '$PWD/my.cnf',
31+
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
32+
},
33+
}
34+
}
35+
EOT
2336
24-
sed -i -e "s@/home/petition/www/@$PWD/@" pytition/pytition/settings/base.py
37+
export DJANGO_SETTINGS_MODULE=pytition.settings.config
2538
2639
echo "Running database migrations"
2740

0 commit comments

Comments
 (0)