Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Nov 21, 2016
1 parent 729c609 commit 24dd558
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions README.md
Expand Up @@ -13,7 +13,13 @@ LINE BOT on AWS Lambda + API Gateway using Chalice.
| News | ![news](./resources/news.png) |
| Echo | ![echo](./resources/echo.png) |

## How to run

## Developing

Chalice-Bot depends a Pillow - Python Imaging Library.
So If you want to create deploy package for AWS Lambda, you must prepare the Amazon Linux.
However, it is very inconvenient to create an instance of EC2 for that.
So please use `Dockerfile.deploy`.

#### Setup

Expand All @@ -27,21 +33,33 @@ $ cat .chalice/config.json
}
```

#### Environment Variables
#### Environment Variables on your local machine

Set environment variables on your AWS console.
```sh
export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export AWS_DEFAULT_REGION=ap-northeast-1
export S3_BUCKET_NAME=xxxxxxxxxxx

```bash
export LINE_BOT_CHANNEL_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export LINE_BOT_CHANNEL_ACCESS_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export LINE_BOT_CHANNEL_ACCESS_TOKEN=
export LINE_BOT_CHANNEL_ACCESS_SECRET=
```

#### Deploy to AWS Lambda and API Gateway

Deploying by chalice cli:

```console
$ chalice deploy
$ make deploy
```

#### Environment variables on your AWS Console

Set environment variables on your AWS console.

```bash
export LINE_BOT_CHANNEL_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export LINE_BOT_CHANNEL_ACCESS_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

#### Configuration on LINE DEVELOPERS
Expand All @@ -52,12 +70,10 @@ Open your line bot setting's page and Set WebHook url.

Success! :tada:

## Development

Chalice-Bot depends a Pillow.
So If you want to create deploy package, you must it in Amazon Linux.
However, it is very inconvenient to create an instance of EC2 for that.
So please use `Dockerfile.deploy`.
#### Others

Other commands for developing are written in Makefile:

```console
$ make help
Expand All @@ -70,26 +86,6 @@ Commands:
help Show help text
```

#### How to deploy

Set environment variables:

```sh
export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export AWS_DEFAULT_REGION=ap-northeast-1
export S3_BUCKET_NAME=xxxxxxxxxxx

export LINE_BOT_CHANNEL_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export LINE_BOT_CHANNEL_ACCESS_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

After that:

```console
$ make deploy
```

## LICENSE

MIT. See [LICENSE](./LICENSE)

0 comments on commit 24dd558

Please sign in to comment.