baked-webhooks-firebase
🚀 Ported Webhooks Application
Functions are hosted: https://console.firebase.google.com/u/0/project/baked-webhooks-firebase/functions
Please contact admin for access
Firebase Docs: https://firebase.google.com/docs/cli
Features​
- task_webhook: Handles ShotGrid Task status change events.
- version_webhook: Handles ShotGrid Version status change events.
- version_created_webhook: Handles ShotGrid Version creation events.
- Local Testing: A
mainfunction for testing via the Functions Framework.
Project Structure​
functions/
├── config.json # ShotGrid & secret token configuration
├── status_mapping.yaml # Version statuses & task relations
├── requirements.txt # Python dependencies
├── main.py # Cloud Functions entrypoints & dispatch logic
├── .firebaserc # Firebase project settings
├── .gitignore # Ignored files
└── venv/ # Python virtual environment
To make changes:​
Get to the right place:
cd functions
Activate environment:
. venv/bin/activate
Deploy:
firebase deploy --only functions
Logs:
firebase functions:log
Configuration​
-
Copy
config.jsonand update values:{
"SHOTGRID_API_KEY": "<your_api_key>",
"SHOTGRID_SCRIPT_NAME": "<your_script_name>",
"SECRET_TOKEN": "<your_secret_token>",
"SHOTGRID_URL": "https://your.shotgrid.url"
} -
Adjust
status_mapping.yamlto match your ShotGrid status keys and labels, and define any task-step relationships:version_statuses:
- key: na
label: N/A
- key: stcomp
label: Step Completed
# ... more statuses
task_step_relations:
Rotoscoping:
triggers_on_status: stcomp
update_steps:
- Composite
- Secondary Composite
new_status: bfr
# ... more relations
Usage​
Check endpoints based on Firebase configuration.
- task_webhook: Deployed URL
/task_webhookreceives task status change webhooks. - version_webhook: Deployed URL
/version_webhookreceives version status change webhooks. - version_created_webhook: Deployed URL
/version_created_webhookreceives new version creation webhooks.
Each endpoint verifies the SECRET_TOKEN header, parses the JSON payload, and dispatches logic to ShotGrid per status_mapping.yaml rules.
Deployment​
-
Log in to Firebase:
firebase login -
Initialize Firebase (if not already done):
firebase init functions -
Deploy functions (Gen-2):
firebase deploy --only functions