mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 12:10:06 -03:30
Merge pull request #11341 from shanemcd/fix-image-builds
Fix official image builds
This commit is contained in:
@@ -151,7 +151,7 @@ def manage():
|
|||||||
from django.core.management import execute_from_command_line
|
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
|
# 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:
|
if (connection.pg_version // 10000) < 12:
|
||||||
sys.stderr.write("Postgres version 12 is required\n")
|
sys.stderr.write("Postgres version 12 is required\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import copy
|
|||||||
import errno
|
import errno
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
import socket
|
||||||
|
|
||||||
# Django Split Settings
|
# Django Split Settings
|
||||||
from split_settings.tools import optional, include
|
from split_settings.tools import optional, include
|
||||||
@@ -88,4 +89,8 @@ except IOError:
|
|||||||
|
|
||||||
# The below runs AFTER all of the custom settings are imported.
|
# 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
|
# AWX settings file
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import base64
|
||||||
|
|
||||||
|
|
||||||
def get_secret():
|
def get_secret():
|
||||||
if os.path.exists("/etc/tower/SECRET_KEY"):
|
if os.path.exists("/etc/tower/SECRET_KEY"):
|
||||||
return open('/etc/tower/SECRET_KEY', 'rb').read().strip()
|
return open('/etc/tower/SECRET_KEY', 'rb').read().strip()
|
||||||
|
else:
|
||||||
|
return base64.encodebytes(os.urandom(32)).decode().rstrip()
|
||||||
|
|
||||||
|
|
||||||
ADMINS = ()
|
ADMINS = ()
|
||||||
@@ -44,6 +47,7 @@ LOGGING['handlers']['console'] = {
|
|||||||
'()': 'logging.StreamHandler',
|
'()': 'logging.StreamHandler',
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'formatter': 'simple',
|
'formatter': 'simple',
|
||||||
|
'filters': ['guid'],
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGING['loggers']['django.request']['handlers'] = ['console']
|
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']['rbac_migrations'] = {'class': 'logging.NullHandler'}
|
||||||
LOGGING['handlers']['system_tracking_migrations'] = {'class': 'logging.NullHandler'}
|
LOGGING['handlers']['system_tracking_migrations'] = {'class': 'logging.NullHandler'}
|
||||||
LOGGING['handlers']['management_playbooks'] = {'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 = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ WORKDIR /tmp/src/
|
|||||||
RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz
|
RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz
|
||||||
|
|
||||||
{% if not headless|bool %}
|
{% 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 %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user