Deploy to Heroku / Webã¢ããªã±ã¼ã·ã§ã³ã®ãã¼ã¿ããªãã£åã³
Heroku ã®æ°æ©è½ã§ Heroku Button ãåºãã
è¦ããããã触ãæ¹ãæ©ãã以ä¸ã®ãã¿ã³ãæ¼ã㨠md2inao ãããªãã® Heroku ã¢ã«ã¦ã³ãã«ãããã¤ãã¦ãåãããã¨ãã§ããã
ãã¿ã³ãæ¼ãã¨ä»¥ä¸ã®ãããªç»é¢ãåºã¦ãDeploy to Free ãæ¼ãã¨ç´ã¡ã«ãããã¤ãå§ã¾ãã
GitHub ããã½ã¼ã¹ã³ã¼ãã Heroku ã«ãããã¤ããã¦ãWeb ã¢ããªã±ã¼ã·ã§ã³ãåãã
ãæºæ¦ã
ãã®ãã¿ã³ã README.md ã«ç½®ãã¦ããã°ãWebã¢ããªã±ã¼ã·ã§ã³ãèªåã§åãããããªã¨æã£ãã¦ã¼ã¶ã¼ããèªåèªèº«ã®ç°å¢ã§å¥½ããªæã«ããããããã¤ãã¦ä½¿ããã¨ãã§ããã
ããªãã¡ãHeroku Button ã§ãURI ãä»ãã Web ã¢ããªã±ã¼ã·ã§ã³ã®äº¤æãå¯è½ã«ãªã£ãã
Heroku Button
Heroku Button ãæå¹ã«ããããã®åæã¯å²ã¨ã·ã³ãã«ã§
- GitHub ã«ã½ã¼ã¹ãç½®ã
- Heroku ã«ãããã¤ã§ããå½¢å¼ã§æ§æãã¦ãã ( Ruby ãªã Gemfile ã¨ã Rack ã¨ã Procfile ã¨ããããã話 )
- app.json ãæ¸ã
- ãããã¤ãã¿ã³ãè¨ç½®
ã¨ãããã®ãapp.json ã¯
{ "name": "md2inao", "env": { "BUILDPACK_URL": "https://github.com/naoya/heroku-buildpack-perl.git#cpanm-with-psgi" } }
ãããã JSON ãã¡ã¤ã«ãapp.json Schema ãè¦ãã¨ãããããã©ã¡ã¼ã¿ãæå®ã§ããããã©ããã·ã³ãã«ãªã¢ããªãªãã»ã¨ãã©è¨è¿°ã¯è¦ããªããmd2inao 㯠Perl 製ã§ãbuildpack ãå¿ è¦ãªã®ã§ããã ãç°å¢å¤æ°ã§æå®ããã
Deploy to Heroku ãã¿ã³ã®ãªã³ã¯å
㯠https://heroku.com/deploy ã ãããã®ã¨ã³ããã¤ã³ããå©ãã¨ãªãã¡ã© (ãããã¯ã¯ã¨ãªãã©ã¡ã¿ã® template
ã«æå®ããã URL) ã«ãã app.json ãèªã¿åããã½ã¼ã¹ã³ã¼ãããããã¤ããã
Pull Request 㨠Heroku Button
Heroku Button ãé¢ç½ãã®ã¯ãã½ã¼ã¹ã³ã¼ãã®ã¬ãã¸ããªã GitHub ãåæã«ãã¦ããç¹ã
app.json ã«æ示çã«ã¬ãã¸ããªURL ãæ¸ããªãå ´åãapp.json ã® URL ã¯ãªãã¡ã©ããåçã«æ±ºå®ããããGitHub ã®å ´å㯠Pull Request ãã³ãããããã·ã¥æ¯ã« URL ãä»ãããªã®ã§ README.md ã«ãããã¤ãã¿ã³ãç½®ã㦠app.json ã®ã¬ãã¸ããªURLã空ã«ãã¦ããã°ãããã ãã§ç¬¬ä¸è ã (master ã ãã§ãªã) ä»»æã®ãã©ã³ãã®ä»»æã®ã³ããããé¸ã㧠Heroku ã«ãããã¤ã§ããããã«ãªãã
以ä¸ã¯ããµã³ãã«ã¢ããªã±ã¼ã·ã§ã³ã®ããã³ãããããããã¤ããä¾ãããã·ã¥å¤ãä»ãã¦ãã®ããããã
ãã£ã¦ Pull Request ãã¼ã¹ã§ Web éçºããã¦ãã¨ãã«ãã¡ãã£ã¨ãã® Pull Request ã®åä½ç¢ºèªãããããªã¨æã£ããããã® Pull Request ã®ãã©ã³ãã® Heroku Button ãããã¦ãããã¤ãã¦åä½ãããã¨ãããã¨ãå¯è½ã«ãªã£ã¦ããã
app.json ããã£ãããPull Request ã®ã¹ã¬ããã«èªåçã« Heroku Button ã表示ãããã¨ãããããæ¹ä¿®ããGitHub (ãã©ã£ãã®ãµã¼ãã¹) ããã£ã¦ããããã¨ãæå¾ ãããã
Immutable Infrastructure / Webã¢ããªã±ã¼ã·ã§ã³ã®ãã¼ã¿ããªãã£
åå¹´ã»ã©åã« ポータブルなWebアプリケーション - naoyaのはてなダイアリー ã«ãImmutable / Disposable Infrastructure ã®æ¦å¿µã«ãã£ã¦ Web ã¢ããªã±ã¼ã·ã§ã³ããã¼ã¿ãã«ã«ãªããçµæçã«ãWeb ã¢ããªã±ã¼ã·ã§ã³ã交æã§ããããã«ãªãã®ã§ã¯ãªããã¨ãã話ãæ¸ããã
Heroku Button ãè¦ã¦ãããããã°ãããªãã¨ãæ¸ãããªãã¨ãããã¨ãæãåºããã
ãåç¥ã®éããHeroku ã®ããã¯ã¨ã³ãã¯ã³ã³ãããã¼ã¹ã®ä»®æ³åç°å¢ãã£ã¦è¨è¨ããã¦ãã¦ãã³ã¼ãã push ãããã³ã«å¤ãã³ã³ããã¯å»æ£ããã¦æ°ããã³ã³ããã«ã¢ããªã±ã¼ã·ã§ã³ããããã¤ããããImmutable Infrastructure ãã®ãã®ã§ããã
常ã«å»æ£ããããã¨ãåæã« Web ã¢ããªã±ã¼ã·ã§ã³ãæ§æããã«ã¯ãWeb ã¢ããªã±ã¼ã·ã§ã³ã«å«ã¾ããå¤é¨ã©ã¤ãã©ãªãªã©ã®å種ä¾åé¢ä¿ãªã宣è¨çã«æè¨ããã¦ããªããã°ãªããªãããã®ããã« Gemfile ã Procfile ãªã©ãããããã®è¾ºãã®ãã©ã¯ãã£ã¹ã¯ The Tweleve-Factor App ãªã©ã«ã¾ã¨ã¾ã£ã¦ããã
çµæçã«ãImmutable ã§ããã¨ããå¶ç´ã Web ã¢ããªã±ã¼ã·ã§ã³ã®å®è¡ç°å¢ã«ãã¼ã¿ããªãã£ãä¸ãã・・・ã¨ããã®ãå ã®ã¨ã³ããªã§æ¸ãããã¨ããã®è¾ºã®è©±ã¯ Immutable Infrastructureãéçºããã»ã¹ã«ä¸ããå½±é¿ ã¨ããã«ã³ãã¡ã¬ã³ã¹çºè¡¨ã§ã話ããã
Heroku Button ã¯ããã®å ¸åçãªã¦ã¼ã¹ã±ã¼ã¹ã ã¨è¨ããã
Docker ã Docker Hub ãªã©ã®æ®åãé²ãã¨ã次㯠Heroku ã¨ããç¹å®ãã³ãã®ã¤ã³ãã©ç°å¢ã«ç¸ãããªããåæ§ã®ã¦ã¼ã¹ã±ã¼ã¹ãå®ç¾ããã¦ããã®ã¯ééããªãã
ã¨ãããã㧠Heroku Button ã¯ã¨ã£ã¦ãã¯ã¼ã«ãã§ããã