run the save all bpmn script on server boot w/ burnettk

This commit is contained in:
jasquat 2022-10-12 14:19:51 -04:00
parent 3be2778649
commit 1cb779015f
3 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,8 @@ if [[ "${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-}" == "true" ]]; then
workers=1
fi
SPIFFWORKFLOW_BACKEND_FAIL_ON_INVALID_PROCESS_MODELS=false poetry run python bin/save_all_bpmn.py
export IS_GUNICORN="true"
export PROCESS_WAITING_MESSAGES="true"

View File

@ -32,5 +32,6 @@ else
export PROCESS_WAITING_MESSAGES="true"
fi
export FLASK_DEBUG=1
SPIFFWORKFLOW_BACKEND_FAIL_ON_INVALID_PROCESS_MODELS=false poetry run python bin/save_all_bpmn.py
FLASK_APP=src/spiffworkflow_backend poetry run flask run -p 7000
fi

View File

@ -1,4 +1,5 @@
"""Grabs tickets from csv and makes process instances."""
import os
from spiffworkflow_backend import get_hacked_up_app_for_script
from spiffworkflow_backend.services.data_setup_service import DataSetupService
@ -10,7 +11,7 @@ def main() -> None:
failing_process_models = DataSetupService.save_all()
for bpmn_errors in failing_process_models:
print(bpmn_errors)
if len(failing_process_models) > 0:
if os.environ.get('SPIFFWORKFLOW_BACKEND_FAIL_ON_INVALID_PROCESS_MODELS') != "false" and len(failing_process_models) > 0:
exit(1)