Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philmod/google-cloud-build-email
Email integration for Google Cloud Container Builder, using Google Cloud Functions
https://github.com/philmod/google-cloud-build-email
cloud email google
Last synced: about 1 month ago
JSON representation
Email integration for Google Cloud Container Builder, using Google Cloud Functions
- Host: GitHub
- URL: https://github.com/philmod/google-cloud-build-email
- Owner: Philmod
- License: apache-2.0
- Created: 2017-07-08T17:51:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-09T19:17:49.000Z (over 7 years ago)
- Last Synced: 2024-10-28T00:19:11.804Z (3 months ago)
- Topics: cloud, email, google
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# google-container-email
Email integration for Google Cloud Container Builder, using Google Cloud Functions to send an email when a build reaches a specific state.
## Setup
- Create a Mailgun account and a domain:
```
export MAILGUN_API_KEY=my-api-key
export MAILGUN_DOMAIN=mydomain.com
export [email protected]
export [email protected]
```
- 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.