forked from sartography/spiff-arena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.yml
113 lines (98 loc) · 5.48 KB
/
manifest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
defaults: &defaults
disk_quota: 3G
memory: 512M
instances: 1
applications:
################################
- name: spiffworkflow((slug))-frontend
<<: *defaults
routes:
- route: spiffworkflow((slug)).app.cloud.gov
docker:
image: ((frontend-image))
env:
APPLICATION_ROOT: "/"
PORT0: "8080"
SPIFFWORKFLOW_FRONTEND_RUNTIME_CONFIG_APP_ROUTING_STRATEGY: "path_based"
SPIFFWORKFLOW_FRONTEND_RUNTIME_CONFIG_BACKEND_BASE_URL: "https://spiffworkflow((slug)).app.cloud.gov/api"
BACKEND_BASE_URL: "https://spiffworkflow((slug)).app.cloud.gov/api"
# We may need to set BACKEND_URL; see spiffworkflow-frontend/src/config/tsx:15-72
# Other vars this image understands:
# CYPRESS_RECORD_KEY
# SPIFFWORKFLOW_FRONTEND_PORT
# SPIFFWORKFLOW_FRONTEND_URL
# CYPRESS_RECORD_KEY
# REACT_APP_BACKEND_BASE_URL
# PUBLIC_URL
# NODE_ENV
#################################
- name: spiffworkflow((slug))-backend
<<: *defaults
disk_quota: 3G
health_check_type: process
routes:
- route: spiffworkflow((slug)).app.cloud.gov/api
services:
- ((db-instance))
# With buildpack:
# path: spiffworkflow-backend
# buildpacks:
# - python_buildpack
# command: DATABASE_URL="$(echo $VCAP_SERVICES | jq --raw-output --arg service_name "((db-instance))" ".[][] | select(.name == \$service_name) | .credentials.uri")?sslmode=require" bin/boot_server_in_docker
# With Docker:
docker:
image: ((backend-image))
command: |
# Get the postgres URI from the service binding. (SQL Alchemy insists on "postgresql://".🙄)
export SPIFFWORKFLOW_BACKEND_DATABASE_URI=$( echo $VCAP_SERVICES | jq -r '.["aws-rds"][].credentials.uri' | sed -e s/postgres/postgresql/ )
/app/bin/clone_process_models
/app/bin/boot_server_in_docker
# command: sleep 6000
env:
# All of the configuration variables are documented here:
# https://github.com/sartography/spiff-arena/blob/main/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py
### Requires VCAP env vars
# VCAP_SERVICES
# SPIFFWORKFLOW_BACKEND_DATABASE_URI: "sqlite:///db.sqlite3"
# Rearrange later
# https://github.com/sartography/spiff-arena/blob/293aa867a1cef056c5bee3ef037be31047fdc49e/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py#L157-L179
SPIFFWORKFLOW_BACKEND_GIT_COMMIT_ON_SAVE: "true"
SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL: ((git-process-models))
SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH: ((target-branch-for-publish))
SPIFFWORKFLOW_BACKEND_GIT_SOURCE_BRANCH: ((source-branch)) # branch needs to exist, otherwise it can't clone it or commit to it on save
SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR: "/app/process_models"
SPIFFWORKFLOW_BACKEND_GIT_SSH_PRIVATE_KEY: ((github-ssh-key))
# These do not appear to be necessary for the core functionality at this time. Since it doesnt use https anymore, and instead uses ssh,
# having these does nothing, as the git history for commits will be tethered to the ssh key. We may use these later.
# SPIFFWORKFLOW_BACKEND_GIT_USERNAME:
# SPIFFWORKFLOW_BACKEND_GIT_USER_EMAIL:
# SPIFFWORKFLOW_BACKEND_GIT_SSH_PRIVATE_KEY_PATH:
# https://github.com/gsa-tts/spiff-arena/blob/main/spiffworkflow-backend/bin/git_commit_bpmn_models_repo
# https://github.com/gsa-tts/spiff-arena/blob/main/spiffworkflow-backend/bin/clone_process_models
# https://github.com/gsa-tts/spiff-arena/blob/main/spiffworkflow-backend/bin/find_sample_process_models
# Hardcoded
FLASK_DEBUG: "0"
APPLICATION_ROOT: "/"
SPIFFWORKFLOW_BACKEND_USE_WERKZEUG_MIDDLEWARE_PROXY_FIX: "true"
SPIFFWORKFLOW_BACKEND_WSGI_PATH_PREFIX: "/api"
# spiffworkflow_backend.config.ConfigurationError: SPIFFWORKFLOW_BACKEND_URL_FOR_FRONTEND and SPIFFWORKFLOW_BACKEND_URL are incompatible. We need backend to set cookies for frontend, so they need to be on the same domain. A common setup is to have frontend on example.com and backend on api.example.com. If you do not need this functionality, you can avoid this check by setting environment variable SPIFFWORKFLOW_BACKEND_CHECK_FRONTEND_AND_BACKEND_URL_COMPATIBILITY=false
SPIFFWORKFLOW_BACKEND_CHECK_FRONTEND_AND_BACKEND_URL_COMPATIBILITY: "false"
SPIFFWORKFLOW_BACKEND_ENV: "local_docker"
SPIFFWORKFLOW_BACKEND_DATABASE_TYPE: "postgres"
SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA: "false"
SPIFFWORKFLOW_BACKEND_LOG_LEVEL: "INFO"
SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_ID: "spiffworkflow-backend"
SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME: "example.yml"
SPIFFWORKFLOW_BACKEND_PORT: "8080"
SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER_IN_CREATE_APP: "true"
SPIFFWORKFLOW_BACKEND_UPGRADE_DB: "true"
# vars.yml (or CLI)
FLASK_SESSION_SECRET_KEY: ((flask-session-key))
SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_SECRET_KEY: "((openid-secret))"
SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL: "https://spiffworkflow((slug)).app.cloud.gov/api/openid"
SPIFFWORKFLOW_BACKEND_URL: "https://spiffworkflow((slug)).app.cloud.gov/api"
SPIFFWORKFLOW_BACKEND_URL_FOR_FRONTEND: "https://spiffworkflow((slug)).app.cloud.gov"
SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL: "https://spiffworkflow-connector((slug)).app.cloud.gov"
# - SPIFFWORKFLOW_BACKEND_DATABASE_URI=mysql+mysqldb://root:${SPIFFWORKFLOW_BACKEND_MYSQL_ROOT_DATABASE:-my-secret-pw}@127.0.0.1:7003/${SPIFFWORKFLOW_BACKEND_DATABASE_NAME:-spiffworkflow_backend_development}
# - SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=http://localhost:7002/realms/spiffworkflow