DB environment variables
Also create the DB during a build Hopefully I'm doing this right
This commit is contained in:
parent
d08fb28c78
commit
2fb809b4e0
|
@ -9,6 +9,11 @@ jobs:
|
|||
# specify the version you desire here
|
||||
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
|
||||
- image: circleci/python:2.7
|
||||
environment:
|
||||
POSTGRES_PASSWORD: totallyHacked1337
|
||||
POSTGRES_USER: imagehost
|
||||
POSTGRES_DB: imagehost_db
|
||||
POSTGRES_HOST: localhost
|
||||
|
||||
# Specify service dependencies here if necessary
|
||||
# CircleCI maintains a library of pre-built images
|
||||
|
@ -20,6 +25,13 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
|
||||
# Set up Test DB
|
||||
- run: sudo apt install postgresql-client-9.4
|
||||
- run: whoami
|
||||
- run: |
|
||||
psql < newdb.sql
|
||||
|
||||
|
||||
# Download and cache dependencies
|
||||
- restore_cache:
|
||||
keys:
|
||||
|
|
|
@ -16,6 +16,10 @@ services:
|
|||
build: .
|
||||
environment:
|
||||
PORTAL_DEBUG: 'true'
|
||||
POSTGRES_PASSWORD: totallyHacked1337
|
||||
POSTGRES_USER: imagehost
|
||||
POSTGRES_DB: imagehost_db
|
||||
POSTGRES_HOST: postgres
|
||||
volumes:
|
||||
- .:/portal
|
||||
ports:
|
||||
|
|
|
@ -101,10 +101,10 @@ WSGI_APPLICATION = 'gallery.wsgi.application'
|
|||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'imagehost_db',
|
||||
'USER': 'imagehost',
|
||||
'PASSWORD': 'totallyHacked1337',
|
||||
'HOST': 'postgres',
|
||||
'NAME': os.environ.get('POSTGRES_DB', ''),
|
||||
'USER': os.environ.get('POSTGRES_USER', 'root'),
|
||||
'PASSWORD': os.environ.get('POSTGRES_PASSWORD', ''),
|
||||
'HOST': os.environ.get('POSTGRES_HOST', 'postgres').lower(),
|
||||
'PORT': '',
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue