Scala+DBMS+Web スカラ座の夜

2011年12月21日

HerokuにEmbedded TomcatヘJava Web Applicationを作る。その2

Filed under: Java — admin @ 1:36 AM

HEROKUへのデプロイ

Gitをコミットします。

$ git init
$ git add .
$ git commit -m "Ready to deploy"

Cedar stackにアプリを生成します。

$ heroku create --stack cedar
Creating cold-river-5491... done, stack is cedar
http://cold-river-5491.herokuapp.com/ | git@heroku.com:cold-river-5491.git
Git remote heroku added

コードをディプロイします。

$ git push heroku master
The authenticity of host 'heroku.com (50.19.85.154)' can't be established.
RSA key fingerprint is aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known
hosts.
Counting objects: 89, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (71/71), done.
Writing objects: 100% (89/89), 4.71 MiB | 103 KiB/s, done.
Total 89 (delta 16), reused 0 (delta 0)

-----> Heroku receiving push
-----> Java app detected
-----> Installing Maven 3.0.3..... done
-----> Installing settings.xml..... done
-----> executing /app/tmp/repo.git/.cache/.maven/bin/mvn -B -Duser.home=/tmp/bui
ld_2v7e7w2fkh8ke -Dmaven.repo.local=/app/tmp/repo.git/.cache/.m2/repository -s /
app/tmp/repo.git/.cache/.m2/settings.xml -DskipTests=true clean install
       [INFO] Scanning for projects...
       [INFO]

       [INFO] ------------------------------------------------------------------
------
       [INFO] Building embeddedTomcatSample Maven Webapp 1.0-SNAPSHOT
       [INFO] ------------------------------------------------------------------
------
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tom
cat-embed-core/7.0.22/tomcat-embed-core-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tomc
at-embed-core/7.0.22/tomcat-embed-core-7.0.22.pom (2 KB at 5.0 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tom
cat-embed-logging-juli/7.0.22/tomcat-embed-logging-juli-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tomc
at-embed-logging-juli/7.0.22/tomcat-embed-logging-juli-7.0.22.pom (2 KB at 10.0
KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tom
cat-embed-jasper/7.0.22/tomcat-embed-jasper-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tomc
at-embed-jasper/7.0.22/tomcat-embed-jasper-7.0.22.pom (2 KB at 8.5 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ja
sper/7.0.22/tomcat-jasper-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jas
per/7.0.22/tomcat-jasper-7.0.22.pom (3 KB at 20.8 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-se
rvlet-api/7.0.22/tomcat-servlet-api-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ser
vlet-api/7.0.22/tomcat-servlet-api-7.0.22.pom (2 KB at 7.1 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ju
li/7.0.22/tomcat-juli-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jul
i/7.0.22/tomcat-juli-7.0.22.pom (2 KB at 6.5 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-js
p-api/7.0.22/tomcat-jsp-api-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jsp
-api/7.0.22/tomcat-jsp-api-7.0.22.pom (2 KB at 12.2 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-el
-api/7.0.22/tomcat-el-api-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-el-
api/7.0.22/tomcat-el-api-7.0.22.pom (2 KB at 9.2 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/eclipse/jdt/core/compil
er/ecj/3.7/ecj-3.7.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/eclipse/jdt/core/compile
r/ecj/3.7/ecj-3.7.pom (2 KB at 7.6 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ja
sper-el/7.0.22/tomcat-jasper-el-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jas
per-el/7.0.22/tomcat-jasper-el-7.0.22.pom (2 KB at 16.4 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ap
i/7.0.22/tomcat-api-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-api
/7.0.22/tomcat-api-7.0.22.pom (2 KB at 4.5 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ut
il/7.0.22/tomcat-util-7.0.22.pom
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-uti
l/7.0.22/tomcat-util-7.0.22.pom (2 KB at 5.4 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tom
cat-embed-core/7.0.22/tomcat-embed-core-7.0.22.jar
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tom
cat-embed-logging-juli/7.0.22/tomcat-embed-logging-juli-7.0.22.jar
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tom
cat-embed-jasper/7.0.22/tomcat-embed-jasper-7.0.22.jar
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ja
sper/7.0.22/tomcat-jasper-7.0.22.jar
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-se
rvlet-api/7.0.22/tomcat-servlet-api-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ser
vlet-api/7.0.22/tomcat-servlet-api-7.0.22.jar (173 KB at 719.6 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ju
li/7.0.22/tomcat-juli-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tomc
at-embed-logging-juli/7.0.22/tomcat-embed-logging-juli-7.0.22.jar (38 KB at 135.
2 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-el
-api/7.0.22/tomcat-el-api-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jas
per/7.0.22/tomcat-jasper-7.0.22.jar (577 KB at 2028.9 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/eclipse/jdt/core/compil
er/ecj/3.7/ecj-3.7.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tomc
at-embed-jasper/7.0.22/tomcat-embed-jasper-7.0.22.jar (768 KB at 2459.8 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ap
i/7.0.22/tomcat-api-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jul
i/7.0.22/tomcat-juli-7.0.22.jar (38 KB at 260.1 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ut
il/7.0.22/tomcat-util-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-el-
api/7.0.22/tomcat-el-api-7.0.22.jar (43 KB at 305.4 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-ja
sper-el/7.0.22/tomcat-jasper-el-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-api
/7.0.22/tomcat-api-7.0.22.jar (7 KB at 46.9 KB/sec)
       Downloading: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-js
p-api/7.0.22/tomcat-jsp-api-7.0.22.jar
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-uti
l/7.0.22/tomcat-util-7.0.22.jar (23 KB at 180.1 KB/sec)
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/embed/tomc
at-embed-core/7.0.22/tomcat-embed-core-7.0.22.jar (2379 KB at 4600.9 KB/sec)
       Downloaded: http://s3pository.heroku.com/jvm/org/eclipse/jdt/core/compile
r/ecj/3.7/ecj-3.7.jar (1671 KB at 5405.4 KB/sec)
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jsp
-api/7.0.22/tomcat-jsp-api-7.0.22.jar (87 KB at 515.5 KB/sec)
       Downloaded: http://s3pository.heroku.com/jvm/org/apache/tomcat/tomcat-jas
per-el/7.0.22/tomcat-jasper-el-7.0.22.jar (120 KB at 474.3 KB/sec)
       [INFO]
       [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ embeddedTomca
tSample ---
       [INFO] Deleting /tmp/build_2v7e7w2fkh8ke/target
       [INFO]
       [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ e
mbeddedTomcatSample ---
       [INFO] Using 'UTF-8' encoding to copy filtered resources.
       [INFO] skip non existing resourceDirectory /tmp/build_2v7e7w2fkh8ke/src/m
ain/resources
       [INFO]
       [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ embedd
edTomcatSample ---
       [INFO] Compiling 2 source files to /tmp/build_2v7e7w2fkh8ke/target/classe
s
       [INFO]
       [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResour
ces) @ embeddedTomcatSample ---
       [INFO] Using 'UTF-8' encoding to copy filtered resources.
       [INFO] skip non existing resourceDirectory /tmp/build_2v7e7w2fkh8ke/src/t
est/resources
       [INFO]
       [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile)
@ embeddedTomcatSample ---
       [INFO] No sources to compile
       [INFO]
       [INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ embeddedTomc
atSample ---
       [INFO] Tests are skipped.
       [INFO]
       [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ embeddedTomcatSampl
e ---
       [INFO] Building jar: /tmp/build_2v7e7w2fkh8ke/target/embeddedTomcatSample
.jar
       [INFO]
       [INFO] --- appassembler-maven-plugin:1.1.1:assemble (default) @ embeddedT
omcatSample ---
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/embed/tomcat-embed-core/7.0.22/tomcat-embed-core-7.0.22.jar to /tmp/build_2v7
e7w2fkh8ke/target/repo/org/apache/tomcat/embed/tomcat-embed-core/7.0.22/tomcat-e
mbed-core-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/embed/tomcat-embed-logging-juli/7.0.22/tomcat-embed-logging-juli-7.0.22.jar t
o /tmp/build_2v7e7w2fkh8ke/target/repo/org/apache/tomcat/embed/tomcat-embed-logg
ing-juli/7.0.22/tomcat-embed-logging-juli-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/embed/tomcat-embed-jasper/7.0.22/tomcat-embed-jasper-7.0.22.jar to /tmp/build
_2v7e7w2fkh8ke/target/repo/org/apache/tomcat/embed/tomcat-embed-jasper/7.0.22/to
mcat-embed-jasper-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-jasper/7.0.22/tomcat-jasper-7.0.22.jar to /tmp/build_2v7e7w2fkh8ke/tar
get/repo/org/apache/tomcat/tomcat-jasper/7.0.22/tomcat-jasper-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-servlet-api/7.0.22/tomcat-servlet-api-7.0.22.jar to /tmp/build_2v7e7w2
fkh8ke/target/repo/org/apache/tomcat/tomcat-servlet-api/7.0.22/tomcat-servlet-ap
i-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-juli/7.0.22/tomcat-juli-7.0.22.jar to /tmp/build_2v7e7w2fkh8ke/target/
repo/org/apache/tomcat/tomcat-juli/7.0.22/tomcat-juli-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-el-api/7.0.22/tomcat-el-api-7.0.22.jar to /tmp/build_2v7e7w2fkh8ke/tar
get/repo/org/apache/tomcat/tomcat-el-api/7.0.22/tomcat-el-api-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/eclipse/jdt
/core/compiler/ecj/3.7/ecj-3.7.jar to /tmp/build_2v7e7w2fkh8ke/target/repo/org/e
clipse/jdt/core/compiler/ecj/3.7/ecj-3.7.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-api/7.0.22/tomcat-api-7.0.22.jar to /tmp/build_2v7e7w2fkh8ke/target/re
po/org/apache/tomcat/tomcat-api/7.0.22/tomcat-api-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-util/7.0.22/tomcat-util-7.0.22.jar to /tmp/build_2v7e7w2fkh8ke/target/
repo/org/apache/tomcat/tomcat-util/7.0.22/tomcat-util-7.0.22.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-jasper-el/7.0.22/tomcat-jasper-el-7.0.22.jar to /tmp/build_2v7e7w2fkh8
ke/target/repo/org/apache/tomcat/tomcat-jasper-el/7.0.22/tomcat-jasper-el-7.0.22
.jar
       [INFO] Installing /app/tmp/repo.git/.cache/.m2/repository/org/apache/tomc
at/tomcat-jsp-api/7.0.22/tomcat-jsp-api-7.0.22.jar to /tmp/build_2v7e7w2fkh8ke/t
arget/repo/org/apache/tomcat/tomcat-jsp-api/7.0.22/tomcat-jsp-api-7.0.22.jar
       [INFO] Installing /tmp/build_2v7e7w2fkh8ke/target/embeddedTomcatSample.ja
r to /tmp/build_2v7e7w2fkh8ke/target/repo/com/heroku/sample/embeddedTomcatSample
/1.0-SNAPSHOT/embeddedTomcatSample-1.0-SNAPSHOT.jar
       [INFO]
       [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ embedde
dTomcatSample ---
       [INFO] Installing /tmp/build_2v7e7w2fkh8ke/target/embeddedTomcatSample.ja
r to /app/tmp/repo.git/.cache/.m2/repository/com/heroku/sample/embeddedTomcatSam
ple/1.0-SNAPSHOT/embeddedTomcatSample-1.0-SNAPSHOT.jar
       [INFO] Installing /tmp/build_2v7e7w2fkh8ke/pom.xml to /app/tmp/repo.git/.
cache/.m2/repository/com/heroku/sample/embeddedTomcatSample/1.0-SNAPSHOT/embedde
dTomcatSample-1.0-SNAPSHOT.pom
       [INFO] ------------------------------------------------------------------
------
       [INFO] BUILD SUCCESS
       [INFO] ------------------------------------------------------------------
------
       [INFO] Total time: 6.654s
       [INFO] Finished at: Tue Dec 20 16:20:46 UTC 2011
       [INFO] Final Memory: 10M/490M
       [INFO] ------------------------------------------------------------------
------
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size is 5.4MB
-----> Launching... done, v5
       http://cold-river-5491.herokuapp.com deployed to Heroku

To git@heroku.com:cold-river-5491.git
 * [new branch]      master -> master

BUILD SUCCESSと表示されれば成功です。

HEROKUのサイトをブラウザでアクセスします。

$ heroku open

以下のURLでHEROKUのアプリがアクセスできます。

http://cold-river-5491.herokuapp.com/

http://cold-river-5491.herokuapp.com/hello

当分、アクセスできると思います。

Comments

comments

Powered by Facebook Comments

コメントはまだありません »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

コメントを投稿するにはログインしてください。

Powered by WordPress