From ff63978da0870690053c1ac0a82c869f299d4eb5 Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Wed, 5 Feb 2020 13:43:59 -0500 Subject: [PATCH 1/2] read the instance/config.py file in IF it exists. --- crc/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crc/__init__.py b/crc/__init__.py index f7e825a3..87483c3a 100644 --- a/crc/__init__.py +++ b/crc/__init__.py @@ -18,7 +18,9 @@ app.config.from_object('config.default') if "TESTING" in os.environ and os.environ["TESTING"] == "true": app.config.from_object('config.testing') app.config.from_pyfile('testing.py') - +else: + # load the instance/config.py, if it exists, when not testing + app.config.from_pyfile('config.py', silent=True) db = SQLAlchemy(app) """:type: sqlalchemy.orm.SQLAlchemy""" From 3b827f2bc9599720d8d0c1850386de3084cd3fe9 Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Wed, 5 Feb 2020 14:54:13 -0500 Subject: [PATCH 2/2] adding travis.yml configuration --- .travis.yml | 12 ++++++++++++ Dockerfile | 5 ----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..e0f5baf7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: python +python: + - "3.6" + - "3.7" + - "3.8" +install: + - pip install pipenv pytest + - pipenv install + - pytest # <== This runs in Pipenv (a/k/a virtualenv) +# command to run tests +script: + - pytest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 61731706..f80a0759 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,11 +19,6 @@ RUN pipenv install --dev # include rejoiner code (gets overriden by local changes) COPY . /crc-workflow/ -# run migrations -ENV FLASK_APP=./crc/__init__.py -RUN pipenv run flask db upgrade -RUN pipenv run flask load-example-data - # run webserver by default CMD ["pipenv", "run", "python", "./run.py"]