Merge branch 'master' into feature_personnel_multi_instance

This commit is contained in:
Dan Funk 2020-04-16 11:22:50 -04:00
commit 565ad01393
8 changed files with 37 additions and 4 deletions

View File

@ -21,6 +21,9 @@ install:
- export PATH=$PATH:$HOME/.local/bin; - export PATH=$PATH:$HOME/.local/bin;
- pipenv install - pipenv install
env:
- PB_BASE_URL='http://workflow.sartography.com:5001/pb/'
script: script:
- pipenv run coverage run -m pytest - pipenv run coverage run -m pytest
- pipenv run coverage xml -i - pipenv run coverage xml -i

2
Pipfile.lock generated
View File

@ -768,7 +768,7 @@
"spiffworkflow": { "spiffworkflow": {
"editable": true, "editable": true,
"git": "https://github.com/sartography/SpiffWorkflow.git", "git": "https://github.com/sartography/SpiffWorkflow.git",
"ref": "4bc0f9252b9274d68ff4cded33f58b8fd3ad8e56" "ref": "d5f385f74ca2f755589aab2588333aa007d20852"
}, },
"sqlalchemy": { "sqlalchemy": {
"hashes": [ "hashes": [

View File

@ -5,14 +5,19 @@ basedir = os.path.abspath(os.path.dirname(__file__))
NAME = "CR Connect Workflow" NAME = "CR Connect Workflow"
CORS_ENABLED = False CORS_ENABLED = False
DEVELOPMENT = environ.get('DEVELOPMENT', default="True") DEVELOPMENT = environ.get('DEVELOPMENT', default="true") == "true"
TESTING = environ.get('TESTING', default="false") == "true"
PRODUCTION = (environ.get('PRODUCTION', default="false") == "true") or (not DEVELOPMENT and not TESTING)
DB_HOST = environ.get('DB_HOST', default="localhost") DB_HOST = environ.get('DB_HOST', default="localhost")
DB_PORT = environ.get('DB_PORT', default="5432") DB_PORT = environ.get('DB_PORT', default="5432")
DB_NAME = environ.get('DB_NAME', default="crc_dev") DB_NAME = environ.get('DB_NAME', default="crc_dev")
DB_USER = environ.get('DB_USER', default="crc_user") DB_USER = environ.get('DB_USER', default="crc_user")
DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass") DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass")
SQLALCHEMY_DATABASE_URI = environ.get('SQLALCHEMY_DATABASE_URI', default="postgresql://%s:%s@%s:%s/%s" % (DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)) SQLALCHEMY_DATABASE_URI = environ.get(
'SQLALCHEMY_DATABASE_URI',
default="postgresql://%s:%s@%s:%s/%s" % (DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)
)
TOKEN_AUTH_TTL_HOURS = 2 TOKEN_AUTH_TTL_HOURS = 2
TOKEN_AUTH_SECRET_KEY = environ.get('TOKEN_AUTH_SECRET_KEY', default="Shhhh!!! This is secret! And better darn well not show up in prod.") TOKEN_AUTH_SECRET_KEY = environ.get('TOKEN_AUTH_SECRET_KEY', default="Shhhh!!! This is secret! And better darn well not show up in prod.")
FRONTEND_AUTH_CALLBACK = environ.get('FRONTEND_AUTH_CALLBACK', default="http://localhost:4200/session") FRONTEND_AUTH_CALLBACK = environ.get('FRONTEND_AUTH_CALLBACK', default="http://localhost:4200/session")
@ -36,3 +41,9 @@ PB_USER_STUDIES_URL = environ.get('PB_USER_STUDIES_URL', default=PB_BASE_URL + "
PB_INVESTIGATORS_URL = environ.get('PB_INVESTIGATORS_URL', default=PB_BASE_URL + "investigators?studyid=%i") PB_INVESTIGATORS_URL = environ.get('PB_INVESTIGATORS_URL', default=PB_BASE_URL + "investigators?studyid=%i")
PB_REQUIRED_DOCS_URL = environ.get('PB_REQUIRED_DOCS_URL', default=PB_BASE_URL + "required_docs?studyid=%i") PB_REQUIRED_DOCS_URL = environ.get('PB_REQUIRED_DOCS_URL', default=PB_BASE_URL + "required_docs?studyid=%i")
PB_STUDY_DETAILS_URL = environ.get('PB_STUDY_DETAILS_URL', default=PB_BASE_URL + "study?studyid=%i") PB_STUDY_DETAILS_URL = environ.get('PB_STUDY_DETAILS_URL', default=PB_BASE_URL + "study?studyid=%i")
print('=== USING DEFAULT CONFIG: ===')
print('DB_HOST = ', DB_HOST)
print('DEVELOPMENT = ', DEVELOPMENT)
print('TESTING = ', TESTING)
print('PB_BASE_URL = ', PB_BASE_URL)

View File

@ -7,3 +7,8 @@ DEVELOPMENT = True
TESTING = True TESTING = True
SQLALCHEMY_DATABASE_URI = "postgresql://crc_user:crc_pass@localhost:5432/crc_test" SQLALCHEMY_DATABASE_URI = "postgresql://crc_user:crc_pass@localhost:5432/crc_test"
TOKEN_AUTH_SECRET_KEY = "Shhhh!!! This is secret! And better darn well not show up in prod." TOKEN_AUTH_SECRET_KEY = "Shhhh!!! This is secret! And better darn well not show up in prod."
print('### USING TESTING CONFIG: ###')
print('SQLALCHEMY_DATABASE_URI = ', SQLALCHEMY_DATABASE_URI)
print('DEVELOPMENT = ', DEVELOPMENT)
print('TESTING = ', TESTING)

View File

@ -21,3 +21,9 @@ SSO_ATTRIBUTE_MAP = {
'displayName': (False, 'display_name'), # Daniel Harold Funk 'displayName': (False, 'display_name'), # Daniel Harold Funk
'title': (False, 'title') # SOFTWARE ENGINEER V 'title': (False, 'title') # SOFTWARE ENGINEER V
} }
print('+++ USING TRAVIS TESTING CONFIG: +++')
print('SQLALCHEMY_DATABASE_URI = ', SQLALCHEMY_DATABASE_URI)
print('DEVELOPMENT = ', DEVELOPMENT)
print('TESTING = ', TESTING)
print('FRONTEND_AUTH_CALLBACK = ', FRONTEND_AUTH_CALLBACK)

View File

@ -22,6 +22,8 @@ else:
app.config.root_path = app.instance_path app.config.root_path = app.instance_path
app.config.from_pyfile('config.py', silent=True) app.config.from_pyfile('config.py', silent=True)
print(app.config)
db = SQLAlchemy(app) db = SQLAlchemy(app)
""":type: sqlalchemy.orm.SQLAlchemy""" """:type: sqlalchemy.orm.SQLAlchemy"""

View File

@ -2,6 +2,12 @@
# run migrations # run migrations
export FLASK_APP=./crc/__init__.py export FLASK_APP=./crc/__init__.py
for entry in ./instance/* ; do
echo "$entry"
cat $entry
done
pipenv run flask db upgrade pipenv run flask db upgrade
if [ "$RESET_DB" = "true" ]; then if [ "$RESET_DB" = "true" ]; then

2
run.py
View File

@ -1,3 +1,3 @@
from crc import app from crc import app
if __name__ == "__main__": if __name__ == "__main__":
app.run(host='0.0.0.0') app.run(host='0.0.0.0', port=5000)