{"id":321,"date":"2012-12-18T09:40:09","date_gmt":"2012-12-18T00:40:09","guid":{"rendered":"https:\/\/blog.id774.net\/entry\/?p=321"},"modified":"2012-12-31T15:46:54","modified_gmt":"2012-12-31T06:46:54","slug":"github-%e3%81%ae%e6%9c%80%e6%96%b0%e3%81%ae-automatic-ruby-%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/blog.id774.net\/entry\/2012\/12\/18\/321\/","title":{"rendered":"GitHub \u306e\u6700\u65b0\u306e Automatic Ruby \u3092\u4f7f\u3046"},"content":{"rendered":"<p><a href=\"https:\/\/rubygems.org\/gems\/automatic\">Automatic Ruby<\/a> \u3092\u4f7f\u3046\u306a\u3089\u3001\u30ea\u30ea\u30fc\u30b9\u7248\u3092\u4f7f\u3063\u3066\u3082\u5341\u5206\u306a\u54c1\u8cea\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u3057\u826f\u3044\u306e\u3060\u304c\u3001 <a href=\"https:\/\/github.com\/id774\/automaticruby\">GitHub \u306e\u6700\u65b0\u72b6\u614b<\/a>\u3092\u4f7f\u3046\u306e\u304c\u3088\u308a\u30aa\u30b9\u30b9\u30e1\u3067\u3042\u308b\u3002<\/p>\n<p>\u65e5\u3005\u306e\u958b\u767a\u306e\u6210\u679c\u304c\u3059\u3050\u306b\u53cd\u6620\u3055\u308c\u308b\u3057 (\u8a00\u3046\u307b\u3069\u958b\u767a\u3057\u3066\u306a\u3044\u3051\u3069) \u3001\u6319\u52d5\u304c\u6c17\u306b\u5165\u3089\u306a\u304b\u3063\u305f\u3068\u304d\u306b\u3061\u3087\u3063\u3068\u30d1\u30c3\u30c1\u3067\u3082\u66f8\u3044\u3066\u9001\u3063\u3066\u3084\u308b\u304b\u3068\u3044\u3046\u6c17\u5206\u306b\u306a\u308b\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u672c\u5f53\u306f\u3042\u308c\u3082\u3053\u308c\u3082\u4f5c\u3089\u306a\u304d\u3083\u3068\u3044\u3046\u72b6\u614b\u306a\u306e\u3067\u3042\u308b\u304c\u3001\u4eca\u3059\u3050\u81ea\u52d5\u3067\u3084\u308a\u305f\u3044\u3053\u3068\u306b\u5dee\u3057\u8feb\u3089\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u3082\u306a\u3044\u306e\u3067\u30ce\u30f3\u30d3\u30ea\u3057\u3066\u3044\u308b\u3002\u30c6\u30b9\u30c8\u3082\u7533\u3057\u8a33\u7a0b\u5ea6\u306b C0 \u30ab\u30d0\u30ec\u30c3\u30b8\u3092\u901a\u3057\u3066\u3044\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u3067\u304d\u308c\u3070\u3082\u3063\u3068\u304d\u3061\u3093\u3068\u5145\u5b9f\u3055\u305b\u305f\u3044\u3068\u3053\u308d\u306a\u306e\u3067\u3042\u308b\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3075\u3060\u3093\u81ea\u52d5\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u3092 automatic \u3068\u3057\u3066\u8aac\u660e\u3059\u308b\u3002<\/p>\n<p><strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb<\/strong><br \/>\n\u591a\u5c11\u306e\u5dee\u306f\u3042\u308c\u3001\u3060\u3044\u305f\u3044\u3053\u306e\u3088\u3046\u306a\u5f62\u306b\u306a\u308b\u3060\u308d\u3046\u3002<br \/>\n1) \/home\/automatic\/bin\/*.sh \u2026 cron \u304b\u3089\u547c\u3070\u308c\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8<br \/>\n2) \/home\/automatic\/.automatic\/config\/*.yml \u2026 \u30ec\u30b7\u30d4<br \/>\n3) \/home\/automatic\/.automatic\/db\/*.db \u2026 SQLite \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9<br \/>\n4) \/home\/automatic\/automaticruby \u2026 \u30db\u30fc\u30e0\u3067 git clone \u3057\u305f\u30ea\u30dd\u30b8\u30c8\u30ea<\/p>\n<p><strong>crontab \u306e\u8a18\u8ff0\u4f8b<\/strong><\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">*\/30 * * * * automatic test -x \/home\/automatic\/bin\/HOGE.sh &amp;&amp; \/home\/automatic\/bin\/HOGE.sh<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><strong>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8<\/strong><br \/>\n\u4e0a\u306e 1) \u306b\u7f6e\u304b\u308c\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4f8b<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">#!\/bin\/sh<br \/>\n<br \/>\n# \u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5b9a\u7fa9<br \/>\nJOBLOG=\/var\/log\/automatic\/HOGE.log<br \/>\n<br \/>\n# \u30b8\u30e7\u30d6\u306e\u958b\u59cb\u65e5\u6642\u3092\u30ed\u30b0\u306b\u8a18\u9332<br \/>\necho -n &quot;*** $0: Job start at `\/bin\/hostname` on &quot;&gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\ndate &quot;+%Y\/%m\/%d %T&quot;&gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\n<br \/>\n# \u30ea\u30ea\u30fc\u30b9\u7248 (gem) \u3092\u4f7f\u3046\u5834\u5408<br \/>\n# \/opt\/ruby\/1.9.3\/bin\/automatic -c HOGE.yml &gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\n<br \/>\n# GitHub \u306e\u6700\u65b0\u3092\u4f7f\u3046\u5834\u5408 (\u304a\u3059\u3059\u3081)<br \/>\n\/opt\/ruby\/1.9.3\/bin\/ruby \/home\/automatic\/automaticruby\/bin\/automatic -c HOGE.yml &gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\n<br \/>\n# \u30b8\u30e7\u30d6\u306e\u7d42\u4e86\u65e5\u6642\u3092\u30ed\u30b0\u306b\u8a18\u9332<br \/>\necho -n &quot;*** $0: End of Job at `\/bin\/hostname` on &quot;&gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\ndate &quot;+%Y\/%m\/%d %T&quot;&gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\necho&gt;&gt;$JOBLOG 2&gt;&amp;1<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u3053\u306e\u4f8b\u3067\u306f Ruby \u304c \/opt\/ruby\/1.9.3 \u306b\u30d3\u30eb\u30c9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u524d\u63d0\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u9069\u5b9c\u8aad\u307f\u66ff\u3048\u3066\u307b\u3057\u3044\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u904b\u7528\u3057\u3066\u3044\u308c\u3070 ~\/automaticruby \u3067 git pull \u3059\u308b\u3060\u3051\u3067\u3044\u3064\u3067\u3082\u6700\u65b0\u306e Automatic Ruby \u306b\u8ffd\u968f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automatic Ruby \u3092\u4f7f\u3046\u306a\u3089\u3001\u30ea\u30ea\u30fc\u30b9\u7248\u3092\u4f7f\u3063\u3066\u3082\u5341\u5206\u306a\u54c1\u8cea\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u3057\u826f\u3044\u306e\u3060\u304c\u3001 GitHub \u306e\u6700\u65b0\u72b6\u614b\u3092\u4f7f\u3046\u306e\u304c\u3088\u308a\u30aa\u30b9\u30b9\u30e1\u3067\u3042\u308b\u3002 \u65e5\u3005\u306e\u958b\u767a\u306e\u6210\u679c\u304c\u3059\u3050\u306b\u53cd\u6620\u3055\u308c\u308b\u3057 (\u8a00\u3046\u307b\u3069\u958b\u767a\u3057\u3066\u306a\u3044\u3051\u3069 &#8230; <a title=\"GitHub \u306e\u6700\u65b0\u306e Automatic Ruby \u3092\u4f7f\u3046\" class=\"read-more\" href=\"https:\/\/blog.id774.net\/entry\/2012\/12\/18\/321\/\" aria-label=\"GitHub \u306e\u6700\u65b0\u306e Automatic Ruby \u3092\u4f7f\u3046 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-321","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/comments?post=321"}],"version-history":[{"count":0,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/321\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/media?parent=321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/categories?post=321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/tags?post=321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}