kopia lustrzana https://github.com/wagtail/wagtail
Drone should pass in relevant settings instead of a RUNNING_IN_DRONE flag
rodzic
cde56af073
commit
fc12d86279
|
@ -1,6 +1,7 @@
|
|||
image: kaedroho/django-base
|
||||
env:
|
||||
- RUNNING_IN_DRONE=yes
|
||||
- DATABASE_HOST=postgres
|
||||
- ELASTICSEARCH_URL=http://elasticsearch:9200/
|
||||
script:
|
||||
- pip3.4 install mock python-dateutil pytz elasticsearch
|
||||
- python3.4 setup.py install
|
||||
|
|
|
@ -16,12 +16,11 @@ DATABASES = {
|
|||
'TEST_NAME': os.environ.get('DATABASE_NAME', 'test_wagtaildemo'),
|
||||
'USER': os.environ.get('DATABASE_USER', 'postgres'),
|
||||
'PASSWORD': os.environ.get('DATABASE_PASS', None),
|
||||
'HOST': os.environ.get('DATABASE_HOST', None),
|
||||
'PORT': os.environ.get('DATABASE_PORT', None),
|
||||
}
|
||||
}
|
||||
|
||||
if os.environ.get('RUNNING_IN_DRONE', False) == 'yes':
|
||||
DATABASES['default']['HOST'] = 'postgres'
|
||||
|
||||
|
||||
SECRET_KEY = 'not needed'
|
||||
|
||||
|
@ -127,8 +126,8 @@ try:
|
|||
}
|
||||
|
||||
# Check if we're running in Drone
|
||||
if os.environ.get('RUNNING_IN_DRONE', False) == 'yes':
|
||||
WAGTAILSEARCH_BACKENDS['elasticsearch']['URLS'] = ['http://elasticsearch:9200/']
|
||||
if 'ELASTICSEARCH_URL' in os.environ:
|
||||
WAGTAILSEARCH_BACKENDS['elasticsearch']['URLS'] = [os.environ['ELASTICSEARCH_URL']]
|
||||
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
Ładowanie…
Reference in New Issue