Only runs upgrade if env variable says to.
This commit is contained in:
parent
b490005af7
commit
2e94ab1584
|
@ -17,7 +17,6 @@ RUN pip install pipenv && \
|
|||
COPY . /app/
|
||||
|
||||
ENV FLASK_APP=/app/crc/__init__.py
|
||||
CMD ["pipenv", "run", "flask", "db", "upgrade"]
|
||||
CMD ["pipenv", "run", "python", "/app/run.py"]
|
||||
|
||||
# expose ports
|
||||
|
|
|
@ -3,17 +3,15 @@
|
|||
# run migrations
|
||||
export FLASK_APP=./crc/__init__.py
|
||||
|
||||
for entry in ./instance/* ; do
|
||||
echo "$entry"
|
||||
cat $entry
|
||||
done
|
||||
|
||||
if [ "$DOWNGRADE_DB" = "true" ]; then
|
||||
echo 'Downgrading...'
|
||||
echo 'Downgrading database...'
|
||||
pipenv run flask db downgrade
|
||||
fi
|
||||
|
||||
pipenv run flask db upgrade
|
||||
if [ "$UPGRADE_DB" = "true" ]; then
|
||||
echo 'Upgrading database...'
|
||||
pipenv run flask db upgrade
|
||||
fi
|
||||
|
||||
if [ "$RESET_DB" = "true" ]; then
|
||||
echo 'Resetting database...'
|
||||
|
|
Loading…
Reference in New Issue