mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #11341 from shanemcd/fix-image-builds
Fix official image builds
This commit is contained in:
commit
aec7ac6ebd
@ -151,7 +151,7 @@ def manage():
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
# enforce the postgres version is equal to 12. if not, then terminate program with exit code of 1
|
||||
if not MODE == 'development':
|
||||
if not os.getenv('SKIP_PG_VERSION_CHECK', False) and not MODE == 'development':
|
||||
if (connection.pg_version // 10000) < 12:
|
||||
sys.stderr.write("Postgres version 12 is required\n")
|
||||
sys.exit(1)
|
||||
|
||||
@ -9,6 +9,7 @@ import copy
|
||||
import errno
|
||||
import sys
|
||||
import traceback
|
||||
import socket
|
||||
|
||||
# Django Split Settings
|
||||
from split_settings.tools import optional, include
|
||||
@ -88,4 +89,8 @@ except IOError:
|
||||
|
||||
# The below runs AFTER all of the custom settings are imported.
|
||||
|
||||
DATABASES['default'].setdefault('OPTIONS', dict()).setdefault('application_name', f'{CLUSTER_HOST_ID}-{os.getpid()}-{" ".join(sys.argv)}'[:63]) # noqa
|
||||
CLUSTER_HOST_ID = socket.gethostname()
|
||||
|
||||
DATABASES.setdefault('default', dict()).setdefault('OPTIONS', dict()).setdefault(
|
||||
'application_name', f'{CLUSTER_HOST_ID}-{os.getpid()}-{" ".join(sys.argv)}'[:63]
|
||||
) # noqa
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
# AWX settings file
|
||||
|
||||
import os
|
||||
import base64
|
||||
|
||||
|
||||
def get_secret():
|
||||
if os.path.exists("/etc/tower/SECRET_KEY"):
|
||||
return open('/etc/tower/SECRET_KEY', 'rb').read().strip()
|
||||
else:
|
||||
return base64.encodebytes(os.urandom(32)).decode().rstrip()
|
||||
|
||||
|
||||
ADMINS = ()
|
||||
@ -44,6 +47,7 @@ LOGGING['handlers']['console'] = {
|
||||
'()': 'logging.StreamHandler',
|
||||
'level': 'DEBUG',
|
||||
'formatter': 'simple',
|
||||
'filters': ['guid'],
|
||||
}
|
||||
|
||||
LOGGING['loggers']['django.request']['handlers'] = ['console']
|
||||
@ -62,6 +66,9 @@ LOGGING['handlers']['tower_warnings'] = {'class': 'logging.NullHandler'}
|
||||
LOGGING['handlers']['rbac_migrations'] = {'class': 'logging.NullHandler'}
|
||||
LOGGING['handlers']['system_tracking_migrations'] = {'class': 'logging.NullHandler'}
|
||||
LOGGING['handlers']['management_playbooks'] = {'class': 'logging.NullHandler'}
|
||||
LOGGING['handlers']['dispatcher'] = {'class': 'logging.NullHandler'}
|
||||
LOGGING['handlers']['job_lifecycle'] = {'class': 'logging.NullHandler'}
|
||||
LOGGING['handlers']['wsbroadcast'] = {'class': 'logging.NullHandler'}
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
|
||||
@ -78,7 +78,8 @@ WORKDIR /tmp/src/
|
||||
RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz
|
||||
|
||||
{% if not headless|bool %}
|
||||
RUN /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear
|
||||
ADD tools/ansible/roles/dockerfile/files/settings.py /etc/tower/settings.py
|
||||
RUN SKIP_PG_VERSION_CHECK=yes /var/lib/awx/venv/awx/bin/awx-manage collectstatic --noinput --clear
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user