generated from pulumi/pulumi-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding environment webhook support, webhook groups (#406)
### Summary - Adding webhook group support - Adding environment webhook support - I have to build this on top on environment project support PR, so this will need to go in only after [this](#398) ### Testing - Manual test - Updating example/integ test --------- Co-authored-by: Sean Yeh <[email protected]> Co-authored-by: Derek <[email protected]>
- Loading branch information
1 parent
a56db10
commit cde69c6
Showing
20 changed files
with
1,091 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
### Improvements | ||
|
||
- Added support for ESC Webhooks and Webhook Groups [#401](https://github.com/pulumi/pulumi-pulumiservice/issues/409) | ||
|
||
### Bug Fixes | ||
|
||
### Miscellaneous |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,57 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import { Webhook, WebhookFormat, WebhookFilters } from "@pulumi/pulumiservice"; | ||
import * as service from "@pulumi/pulumiservice"; | ||
import { WebhookGroup, WebhookFormat, WebhookFilters } from "@pulumi/pulumiservice"; | ||
|
||
const serviceOrg = "service-provider-test-org"; | ||
let config = new pulumi.Config(); | ||
|
||
const webhook = new Webhook("wh", { | ||
var environment = new service.Environment("environment-to-use", { | ||
organization: serviceOrg, | ||
project: "test-project", | ||
name: "testing-environment-ts-"+config.require("digits"), | ||
yaml: new pulumi.asset.StringAsset( | ||
`values: | ||
myNumber: 1` | ||
) | ||
}) | ||
|
||
// Organization webhook subscribed to all events | ||
const webhookAllEvents = new service.Webhook("org-webhook-all", { | ||
active: true, | ||
displayName: "webhook-from-provider", | ||
organizationName: serviceOrg, | ||
payloadUrl: "https://google.com", | ||
filters: [WebhookFilters.DeploymentStarted, WebhookFilters.DeploymentSucceeded], | ||
}); | ||
|
||
const stackWebhook = new Webhook("stack-webhook", { | ||
// Organization webhook only subscribed to environments and stacks groups | ||
const webhook = new service.Webhook("org-webhook-groups", { | ||
active: true, | ||
displayName: "webhook-from-provider", | ||
organizationName: serviceOrg, | ||
payloadUrl: "https://google.com", | ||
groups: [ WebhookGroup.Environments, WebhookGroup.Stacks ] | ||
}); | ||
|
||
// Stack webhook subscribed to a group and specific filters | ||
const stackWebhook = new service.Webhook("stack-webhook", { | ||
active: true, | ||
displayName: "stack-webhook", | ||
organizationName: serviceOrg, | ||
projectName: pulumi.getProject(), | ||
stackName: pulumi.getStack(), | ||
payloadUrl: "https://example.com", | ||
format: WebhookFormat.Slack, | ||
groups: [ WebhookGroup.Stacks ], | ||
filters: [WebhookFilters.DeploymentStarted, WebhookFilters.DeploymentSucceeded], | ||
}) | ||
|
||
export const orgName = webhook.organizationName; | ||
export const name = webhook.name; | ||
export const stackWebhookName = stackWebhook.name; | ||
export const stackWebhookProjectName = stackWebhook.projectName; | ||
// Environment webhook subscribed to specific filters only | ||
const environmentWebhook = new service.Webhook("env-webhook", { | ||
active: true, | ||
displayName: "env-webhook", | ||
organizationName: serviceOrg, | ||
projectName: environment.project, | ||
environmentName: environment.name, | ||
payloadUrl: "https://example.com", | ||
filters: [WebhookFilters.EnvironmentRevisionCreated, WebhookFilters.ImportedEnvironmentChanged], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.