Skip to content

Commit

Permalink
Added heroku button
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Oct 11, 2016
1 parent d569a80 commit a9c2bd3
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 14 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: java $JAVA_OPTS -jar sample-spring-boot-echo/build/libs/sample-spring-boot-echo-*.jar --server.port=$PORT
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ This project contains following modules:

There's some sample projects:

* sample-spring-boot-echo: Simple echo server.
* sample-spring-boot-echo: Simple echo server. There's heroku button.
* sample-spring-boot-kitchensink: Full featured sample code.

## Requirements
Expand Down
15 changes: 15 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "echo bot - LINE Messaging API",
"description": "This is a sample application for LINE Messaging API",
"keywords": ["chatbot", "line", "java"],
"env": {
"LINE_BOT_CHANNEL_TOKEN": {
"description": "LINE Bot channel access token from LINE Developers",
"required": true
},
"LINE_BOT_CHANNEL_SECRET": {
"description": "LINE Bot channel secret from LINE Developers",
"required": true
}
}
}
31 changes: 19 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ subprojects {
apply plugin: 'propdeps-eclipse'
apply plugin: 'findbugs'
apply plugin: 'java'
apply plugin: 'com.gorylenko.gradle-git-properties'
if (new File("${project.rootDir}/.git").exists()) {
println("There's .git directory")
apply plugin: 'com.gorylenko.gradle-git-properties'
} else {
println("There's no .git directory.");
}
apply plugin: 'io.spring.dependency-management'

sourceCompatibility = 1.8
Expand Down Expand Up @@ -109,14 +114,20 @@ subprojects {
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from "${buildDir}/javadoc"
}
if (!project.name.startsWith('sample-')) {
task javadocJar(type: Jar) {
classifier = 'javadoc'
from "${buildDir}/javadoc"
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
artifacts {
archives javadocJar, sourcesJar
}
}

compileJava {
Expand All @@ -127,10 +138,6 @@ subprojects {
}
}

artifacts {
archives javadocJar, sourcesJar
}

project.plugins.withType(org.springframework.boot.gradle.plugin.SpringBootPlugin) {
bootRun {
systemProperties System.properties
Expand Down
37 changes: 36 additions & 1 deletion sample-spring-boot-echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,42 @@ You can run this sample bot via gradle.
../gradlew bootRun -Dline.bot.channelToken=YOUR_CHANNEL_TOKEN \
-Dline.bot.channelSecret=YOUR_CHANNEL_SECRET

You need to path following 2 options.
You need to pass following 2 options.

* line.bot.channelToken: Your channel access token
* line.bot.channelSecret: Your channel secret

## Deploy on heroku

You can deploy this module on heroku.

### Step 1

You need to get channel access token and channel secret from LINE Developers.

<img src="https://github.com/line/line-bot-sdk-java/blob/heroku/sample-spring-boot-echo/_assets/line-bot-configuration.png?raw=true">

### Step 2

Tap deploy button.

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

### Step 3

Fill form and run your own instance.

<img src="https://github.com/line/line-bot-sdk-java/blob/heroku/sample-spring-boot-echo/_assets/heroku.png?raw=true">

Then, tap "Manage app" button and take your heroku instance's name.

<img src="https://github.com/line/line-bot-sdk-java/blob/heroku/sample-spring-boot-echo/_assets/heroku-app-name.png?raw=true">

### Step 4

Put webhoook URL on LINE developers.

Your webhook URL is: `https://${YOUR_HEROKU_APP_NAME}.herokuapp.com/callback`

<img src="https://github.com/line/line-bot-sdk-java/blob/heroku/sample-spring-boot-echo/_assets/put-webhook-url.png?raw=true">

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sample-spring-boot-echo/_assets/heroku.png
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.
1 change: 1 addition & 0 deletions system.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java.runtime.version=1.8

0 comments on commit a9c2bd3

Please sign in to comment.