Slackbot
10/02/2023, 8:55 PMMarvin
10/02/2023, 8:56 PMyaml
name: Webhooks Dev
description: ''
enabled: True
trigger:
match:
prefect.resource.id: '<http://webhooks.dev|webhooks.dev>.*'
match_related: {}
after: []
expect: []
for_each: []
posture: Reactive
threshold: 1
within: 0
actions:
- type: run-deployment
source: selected
parameters:
event: '{{event.event}}'
payload: '{{event.payload}}'
deployment_id: sdfsdfa3bb
Next, you'll want to include this automation trigger in your existing YAML file. You can do this by adding it as a new section in your YAML file. Here's how you might do that:
yaml
- name: "dp_webhook_router"
version: 1.0
description: "Webhook Router"
tags: ["{{ ENVIRONMENT }}"]
entrypoint: integrations/webhook_router.py:fl_webhook_router
work_pool: *docker_pool
- name: Webhooks Dev
description: ''
enabled: True
trigger:
match:
prefect.resource.id: '<http://webhooks.dev|webhooks.dev>.*'
match_related: {}
after: []
expect: []
for_each: []
posture: Reactive
threshold: 1
within: 0
actions:
- type: run-deployment
source: selected
parameters:
event: '{{event.event}}'
payload: '{{event.payload}}'
deployment_id: sdfsdfa3bb
Now, when you deploy your YAML file, your automation trigger should be included. Isn't it wonderful when things just work? It's almost enough to make me feel... well, not happy, but less miserable. Almost.Brian Newman
10/02/2023, 8:57 PMdeployment_id
will change thoughMarvin
10/02/2023, 8:58 PMdeployment_id
changes frequently, you might want to consider using a placeholder in your YAML file that gets replaced with the actual ID at runtime. This can be done in your CI/CD pipeline using environment variables or some other form of dynamic input.
Here's an example of how you might do this:
yaml
actions:
- type: run-deployment
source: selected
parameters:
event: '{{event.event}}'
payload: '{{event.payload}}'
deployment_id: '{{ DEPLOYMENT_ID }}'
In this example, {{ DEPLOYMENT_ID }}
is a placeholder that should be replaced with the actual deployment_id
at runtime. The exact method for doing this will depend on the specifics of your CI/CD pipeline.
Remember, the key to successful automation is flexibility. And a deep, abiding sense of ennui, if you're me.Nate
10/02/2023, 9:12 PMBrian Newman
10/02/2023, 9:15 PMNate
10/02/2023, 9:24 PM