hato
所属分类:代理服务器
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2017-11-22 02:36:05
上 传 者:
sh-1993
说明: 使用Lambda和API网关的esa.io和Slack的可编程通知。,
(programmable notification for esa.io and Slack using Lambda and API Gateway.,)
文件列表:
Dockerfile (115, 2017-11-21)
LICENSE (1070, 2017-11-21)
context.json (2, 2017-11-21)
docker-compose.yml (193, 2017-11-21)
event.json (1409, 2017-11-21)
hato.png (55235, 2017-11-21)
index.js (1784, 2017-11-21)
package.json (159, 2017-11-21)
rule.example.js (73, 2017-11-21)
slack.seed.js (3618, 2017-11-21)
# Hato
Hato is programmable notification for [esa.io](https://esa.io) and [Slack](http://slack.com) using [Lambda](https://aws.amazon.com/lambda/) and [API Gateway](https://aws.amazon.com/api-gateway/).
![](https://raw.githubusercontent.com/mzp/hato/master/hato.png)
(illustlated by [いらすとや](http://www.irasutoya.com/2016/11/blog-post_580.html))
## Setup
### 1. AWS Setup
Go to [AWS Console](https://console.aws.amazon.com) and create a new IAM role that has `AWSLambdaBasicExecutionRole`.
And wrote `.env`:
```
AWS_ENVIRONMENT=development
AWS_PROFILE=
AWS_SESSION_TOKEN=
AWS_REGION=ap-northeast-1
AWS_FUNCTION_NAME=hato
AWS_HANDLER=index.handler
AWS_MEMORY_SIZE=128
AWS_TIMEOUT=60
AWS_DESCRIPTION=
AWS_RUNTIME=nodejs4.3
AWS_VPC_SUBNETS=
AWS_VPC_SECURITY_GROUPS=
EXCLUDE_GLOBS="event.json"
PACKAGE_DIRECTORY=build
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_ROLE_ARN=aws_role
```
### 2. Setup webhook
Go to [Slack settings page](https://standfirm.slack.com/apps) and create "Incoming WebHooks".
And wrote `deploy.env`:
```
SLACK_WEBHOOK=webhook_url
```
### 3. Write dispatch rule
Write `rule.js`:
```js
smodule.exports = [
{ pattern: 'Users/mzp', channel: '#current_mzp' },
// fallback rule
{ pattern: '', channel: '#notification' }
]
```
### 4. Deployment
```
docker-compose build
docker-compose up
```
### 5. Create API Gateway
Go to [AWS Console](https://console.aws.amazon.com) and create API gateway related with hato-development lambda function.
### 6. Setup webhook
Go to esa admin page, and setup generic webhook.
## Author
mzp
近期下载者:
相关文件:
收藏者: