-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
132 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## Pre-requisites: | ||
|
||
- Line app | ||
- Github | ||
- Heroku | ||
|
||
|
||
## Steps: | ||
|
||
1. Login/Sign up | ||
2. Create a LINE@ account with enabled Messaging API on [Line Business Center](https://business.line.me/en/) | ||
3. Configure your bot | ||
4. Develop your bot | ||
5. Deploy your bot | ||
|
||
## 1- Login/Sign up: | ||
|
||
If you have Line account then move to next step else sign up for an account and make | ||
one. | ||
## 2- Create a LINE@ account with enabled Messaging API: | ||
|
||
- In the [Line Business Center](https://business.line.me/en/), select Messaging API under the [Service](https://business.line.me/en/services/bot/) category at the top of the page. | ||
- Select either Start using Messaging API. | ||
- Enter the required information for your new LINE@ account. Confirm the information. | ||
- Click the LINE@ MANAGER button at the bottom of the confirmation page. | ||
- Go to the settings and then Bot Settings page of the LINE@ Manager then click Enable API. | ||
|
||
![LINE_LOGIN](/docs/images/Line_Business_Center_Login.PNG) | ||
|
||
## 3- Configure your bot: | ||
|
||
- In the LINE@ Manager, go to the Bot Settings, which can be found under "Settings" on the side menu. | ||
- To reply to messages using webhooks, select Allow for "Use webhooks" under "Request Settings" | ||
- To participate in group chats, select Allow for the "Allow bots to join group chats" option. | ||
- To send a customized response message to user messages, select Allow for the "Auto Reply Message" option. | ||
- To send a customized greeting message when users add your account as a friend, select Allow for the "Greeting Message" option | ||
|
||
![BOT_SETTINGS](/docs/images/Bot_Settings.PNG) | ||
|
||
Go to Accounts option at top of page and open LINE Developers from there | ||
|
||
- To issue a Channel access token for accessing APIs, click ISSUE for the "Channel access token" item. | ||
- Click EDIT and set a webhook URL for your Channel. | ||
|
||
![CHANNEL_CONSOLE](/docs/images/Channel_Console.PNG) | ||
After following these steps your account is ready and you are good to go to develop your bot. | ||
|
||
## 4- Develop your bot: | ||
|
||
You can develop your own bot or you can fork this repository and deploy it to heroku. | ||
|
||
## 5- Deploy your bot: | ||
|
||
To deploy your bot to heroku you need an account on [Heroku](https://www.heroku.com/) and after making an account make an app | ||
|
||
You can see how to deploy on [Heroku blog](https://devcenter.heroku.com/articles/git) | ||
|
||
After making app copy this link and paste it in webhook url in Line channel console page from where we got channel access token. | ||
|
||
https:{your_heroku_app_name}.herokuapp.com/webhook | ||
|
||
![WEBHOOK_URL](/docs/images/WebHook_Url.PNG) | ||
|
||
And now you application already active. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## Setup: | ||
|
||
- If you don't already have a Google Account (Gmail or Google Apps), you must [create one](https://accounts.google.com/SignUp). Then, sign-in to Google Cloud Platform console ( [cloud.google.com](http://console.cloud.google.com/)) and create a new project. | ||
|
||
- Subscribe [free tier](https://cloud.google.com/free/) for 12 months.Next, [enable billing](https://console.cloud.google.com/billing) in the Cloud Console in order to use Google Cloud resources and [enable the Container Engine API](https://console.cloud.google.com/project/_/kubernetes/list). | ||
|
||
- Install [Docker](https://docs.docker.com/engine/installation/), and [Google Cloud SDK](https://cloud.google.com/sdk/). | ||
- Finally, after Google Cloud SDK installs, run the following command to install kubectl: | ||
gcloud components install kubectl | ||
|
||
- Choose a [Google Cloud Project zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) to run your service. We will be using us-central1. This is configured on the command line via: | ||
|
||
gcloud config set compute/zone us-central1 | ||
|
||
|
||
## Registering a Domain and Pre Deployment Steps: | ||
|
||
- You can register free domain at [http://www.freenom.com](http://www.freenom.com/).Next, you have to set IP for DNS of this domain. | ||
|
||
- Reserve static IP address with this command: | ||
|
||
gcloud compute addresses create IPname --region us-central1 | ||
|
||
- You will get a created message. To see your IP go to VPC Network -> External IP addresses. | ||
|
||
- Add this IP to DNS zone of your domain and to the kubernetes/yamls/nginx/service.yaml file for "loadBalancerIP" parameter. | ||
|
||
- Change enviroment variavles in kubernetes/yamls/application/deployment.yaml | ||
|
||
- Replace domain name in kubernetes/yamls/application/ingress-notls.yaml and kubernetes/yamls/application/ingress-tls.yaml with your domain name. | ||
|
||
- Add your email ID to kubernetes/yamls/lego/configmap.yaml for "lego.email" parameter. | ||
|
||
|
||
## Deployment: | ||
|
||
- First create a cluster | ||
|
||
gcloud container clusters create clusterName | ||
|
||
- In gcloud shell run the following command to deploy application using given configurations. | ||
|
||
bash ./kubernetes/deploy.sh create all | ||
|
||
- This will create the deployment as we have defined in the script. | ||
|
||
- The Kubernetes master creates the load balancer and related Compute Engine forwarding rules, target pools, and firewall rules to make the service fully accessible from outside of Google Cloud Platform. | ||
|
||
- Wait for a few minutes for all the containers to be created and the SSL Certificates to be generated and loaded. | ||
|
||
## Tracking: | ||
|
||
- To track the progress using the Web GUI run | ||
|
||
kubectl proxy | ||
|
||
- After that goto [http://localhost:8001/ui](http://localhost:8001/ui) | ||
|
||
## Cleanup: | ||
|
||
- If you want to delete the deployment from the cluster enter this command: | ||
|
||
bash ./kubernetes/deploy.sh delete all | ||
|
||
|
||
- To delete cluster enter: | ||
|
||
gcloud container clusters delete clusterName |