Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philmod/google-builder-webhook
Webhook integration for Google Cloud Container Builder, using Google Cloud Functions
https://github.com/philmod/google-builder-webhook
Last synced: 27 days ago
JSON representation
Webhook integration for Google Cloud Container Builder, using Google Cloud Functions
- Host: GitHub
- URL: https://github.com/philmod/google-builder-webhook
- Owner: Philmod
- License: apache-2.0
- Created: 2017-09-30T17:20:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-30T21:49:29.000Z (over 7 years ago)
- Last Synced: 2024-10-28T00:19:11.980Z (3 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# google-container-webhook
Webhook integration for Google Cloud Container Builder, using Google Cloud Functions to send an http request to a webhook when a build reaches a specific state.
## Setup
- Set the webhook address:
```
export WEBHOOK=https://requestb.in/1myqgic1
```
- Set the `PROJECT_ID` variable:
```
export PROJECT_ID=my-project-id
```
- [Optionally] Set a specific `BUCKET_NAME` and a `FUNCTION_NAME`.
- [Optionally] Set the status you want a message for, here are the default ones:
```
export GC_STATUS="SUCCESS FAILURE TIMEOUT INTERNAL_ERROR"
```
- Create the function:
```
. ./setup.sh
# OR
npm run setup
```## Teardown
The teardown script will delete the function `FUNCTION_NAME`, and the bucket `BUCKET_NAME`.
```
. ./teardown.sh
# OR
npm run teardown
```## FAQ
### How much does it cost?
Each build invokes 3 times the function:
- when the build is queued
- when the build starts
- when the build reaches a final status.Here is the [GCF pricing](https://cloud.google.com/functions/pricing) for calculation.
### Can I use an existing bucket?
Yes, specify the `BUCKET_NAME`:
```
exports BUCKET_NAME=my-bucket
```
### How can I update a function?
If you use the setup script with the same `FUNCTION_NAME`, it will update the existing function.### Why do I have to source the script?
In the case where a `BUCKET_NAME` is not defined, a random one is generated. And in order to delete it during the teardown, the variable has to be exported from the setup script.