make git commit on save configurable
This commit is contained in:
parent
8c5e11ca68
commit
427960698d
|
@ -23,6 +23,10 @@ SPIFFWORKFLOW_BACKEND_URL = environ.get(
|
|||
"SPIFFWORKFLOW_BACKEND_URL", default="http://localhost:7000"
|
||||
)
|
||||
|
||||
GIT_COMMIT_ON_SAVE = (
|
||||
environ.get("GIT_COMMIT_ON_SAVE", default="false") == "true"
|
||||
)
|
||||
|
||||
# Open ID server
|
||||
OPEN_ID_SERVER_URL = environ.get("OPEN_ID_SERVER_URL", default="http://localhost:7002")
|
||||
OPEN_ID_CLIENT_ID = environ.get("OPEN_ID_CLIENT_ID", default="spiffworkflow-backend")
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
"""Staging."""
|
||||
GIT_COMMIT_ON_SAVE = True
|
||||
|
|
|
@ -270,10 +270,15 @@ def process_model_file_update(
|
|||
)
|
||||
|
||||
SpecFileService.update_file(process_model, file_name, request_file_contents)
|
||||
git_output = GitService.commit(
|
||||
message=f"User: {g.user.username} clicked save for {process_group_id}/{process_model_id}/{file_name}"
|
||||
)
|
||||
current_app.logger.info(f"git output: {git_output}")
|
||||
|
||||
if current_app.config["GIT_COMMIT_ON_SAVE"]:
|
||||
git_output = GitService.commit(
|
||||
message=f"User: {g.user.username} clicked save for {process_group_id}/{process_model_id}/{file_name}"
|
||||
)
|
||||
current_app.logger.info(f"git output: {git_output}")
|
||||
else:
|
||||
current_app.logger.info("Git commit on save is disabled")
|
||||
|
||||
return Response(json.dumps({"ok": True}), status=200, mimetype="application/json")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue