Webアプリエンジニア養成読本 Advent Calendar 2014 - Qiita ã®19æ¥ç®ã§ããããããæ¸ããã¨ãªããªã£ã¦ãã¾ãããã
- ä½è : åç°è£ä»,ç³ç°çµ¢ä¸(uzulla),ããããã¾ãã®ã,æè¤ç¥ä¸é
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2014/03/11
- ã¡ãã£ã¢: 大åæ¬
- ãã®ååãå«ãããã° (5件) ãè¦ã
æ¬æ¸ãèªãã ããªãã
ãããRubyãæ°ã«å ¥ã£ã¦ããã¦ããã®ã ãã©ãç´è¿ã®ããã¸ã§ã¯ãã§Rubyã¯ä½¿ããªããã ãªã¼ã¨ããå ´åã«å½¹ç«ã¤ããããã¾ããã
ãããã¸ã§ãã³ã°ãã¼ã«ã使ã£ã¦ã¿ãã
æè¿æµè¡ã£ã¦ã¾ããããDevOpsã£ã¦ã¤ãããããªãã¹ãRuby製ã®ãã¼ã«ã¨ãã¦ã¯Chefãä¸ä¸ã風é¡ãããã¨ã¯è¨æ¶ã«ãããããã¨ããã§ãã
ãããããã®ä¸ã¯Chefç²ããèµ·ãã人ã ã§ããµãã¦ãã¾ã*1ãæ¬ç¨¿ã§ã¯ããå°ããæ軽ã«ä½¿ãããã¼ã«ã¨ã㦠ryotarai/itamae · GitHub ã«ã¤ãã¦èª¬æãã¦ããã¾ãã
Chefãitamaeã¯DSLã§è¨å®ãæ¸ãã¦ããã¹ã¿ã¤ã«ã§ãããRubyã®æ§æã使ãã¾ãã®ã§ãæ¬æ¸ã§æã«å ¥ããç¥èãå½¹ã«ç«ã¤æã§ãï¼
itamaeãã¤ã³ã¹ãã¼ã«ãã
åæã¨ãªãç°å¢ã¯ä»¥ä¸ã®ã¨ããã§ã
- OSX Yosemite
- Homebrewãã¤ã³ã¹ãã¼ã«ããã¦ãã
- Bundlerãã¤ã³ã¹ãã¼ã«ããã¦ãã
ã¾ãã¯Gemfileã®çæãè¡ãã¾ãã
$ bundle init Writing new Gemfile to /private/tmp/itamae_sample/Gemfile
ããããã«Gemfileãç·¨éãã¾ãã
# A sample Gemfile source "https://rubygems.org" gem "itamae"
Gemfileã®ç·¨éãè¡ã£ãã bundle install
ãå®è¡ãã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
ã¬ã·ããã¡ã¤ã«ãä½æãã¾ã
ããã§ã¯ãèªåã®OSXã®ç°å¢æ§ç¯ã§ã¤ã³ã¹ãã¼ã«ããã決ã¾ãã®ãã¼ã«ãitamaeã§ã¤ã³ã¹ãã¼ã«ããããã«ãã¦ã¿ã¾ããã*2ã
recipe.rbã¨ãããã¡ã¤ã«ãä½æããä¸è¨ã®å 容ãè¨è¿°ãã¦ã¿ã¾ããããgolangãããã±ã¼ã¸ã³ã°ã·ã¹ãã ã使ã£ã¦ã¤ã³ã¹ãã¼ã«ããããã®å 容ã§ãã
package
ã¯å®è¡ãããOSã«ãã£ã¦æé©ãªããã±ã¼ã¸ã·ã¹ãã ãé¸æããã¾ããã¤ã¾ããOSXä¸ã§å®è¡ããå ´åã¯Homebrewãé¸æããã¾ãã
package 'go'
ããã ãè¨è¿°ããããitamaeãå®è¡ãã¦ã¿ã¾ãã
itamaeã«ã¯localã¢ã¼ãã¨sshã¢ã¼ããããã¾ãããä»åã¯ãã¼ã«ã«ã«å¯¾ãã¦å®è¡ãããã®ã§localã¨ããå¼æ°ã使ã£ã¦ãã¾ããããã¦ãæå¾ã«ä½æããã¬ã·ããã¡ã¤ã«ã®ãã¹ãæå®ãã¦ããã¾ãã
$ bundle exec itamae local recipe.rb INFO : Starting Itamae... INFO : Recipe: /private/tmp/itamae_sample/recipe.rb INFO : package[go] INFO : action: install
ããããã¨ãgoããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã¾ããã
ããã¡ãã£ã¨Rubyã£ã½ããâ¦â¦
ããã ãã§ããã¤ï¼Rubyã§æãã¦ä¾¿å©ããï¼ããªã©ã¨è¨ããã¦ãããã¡ãRubyã£ããããã¨ãããããªãã¨æãã®ã§ãããã¡ãã£ã¨Rubyã£ã½ãæãã§ãããä¾ã«ãã¦ã¿ã¾ããããä¾ãã°ãgoã ãã§ã¯ãªããtreeãã¤ã³ã¹ãã¼ã«ããã!!ã¨ããæãæç´ã«æ¸ãã¨ãããªæãã«ãªãã§ãããã
package 'go' package 'tree'
ãããããã¯Rubyã®ä¸çããã®ããã«ãæ¸ãã¾ãã
%w(go tree).each do |name| package name end
goã¨treeãRubyã®æ§æã§é åã«ãã¦eachã§ç¹°ãè¿ãããã«ãã¾ããã
$ bundle exec itamae local recipe2.rb INFO : Starting Itamae... INFO : Recipe: /private/tmp/itamae_sample/recipe2.rb INFO : package[go] INFO : action: install INFO : package[tree] INFO : action: install
ãããå®è¡ããã¨ãè¤æ°ã®ãã¡ã¤ã«ãèªã¿è¾¼ã¾ãã¦ããã®ããããã¾ããã
itamaeèªä½ã¯è¨å®ãã¡ã¤ã«ãjsonã§å¤åºãã«ããæ©æ§ãããã®ã§ããã¾ããããã使ãæ¹ã¯ããªãããããã¾ããããç¨éã«å¿ãã¦ãç°¡ç´ ã«æ¸ããæ¹æ³ãèãã¦ããã®ãè¯ãã§ããã
éãªã¾ã¨ã
- itamaeã¯ä¾¿å©
- itamaeã¯Rubyãæ¸ããã®ã§ä¾¿å©
- itamaeã¯Chefã¨éã£ã¦å°ãªãè¨å®ã§ãããã®ã§ããã¼ã«ã«ã®ç°å¢æ§ç¯ã¨ãã«ä¾¿å©
- itamaeã®è©³ç´°ã¯GitHubãè¦ããï¼ï¼å½ããåã§ããpackage以å¤ã«ãgitã¨ãè²ã ããã¾ãï¼ï¼
- itamaeèªä½ã¯ããã¯ã¨ã³ãã« serverspec/specinfra · GitHub ã使ã£ã¦ãããããRedHatãBSDã§ãåãã¾ã*3
- Serverspecã¨åããã®ã使ã£ã¦ããã¨ãããã¨ã§ãã
- ããã«Rubyã触ããªãç¶æ ã§ããRubyã使ãç¨éã¯ã¢ããªã±ã¼ã·ã§ã³ä»¥å¤ã«ãããã®ã§ãããããã¨ããããçãã¨è¯ãããããã¾ãã
æ¸ããªãã¦ã¯ãªããªã宣ä¼
itamaeã®è¨å®ãæ¸ããããã§ããã°ãRubyãç°¡åã«ç¥ã£ã¦ããã°ååãªã®ã§ãâã®Rubyã®è§£èª¬ãèªãã ãããã§ããªãã¨ãã§ããããããªãããªã¼ã¨æãã¾ã!!
- ä½è : åç°è£ä»,ç³ç°çµ¢ä¸(uzulla),ããããã¾ãã®ã,æè¤ç¥ä¸é
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2014/03/11
- ã¡ãã£ã¢: 大åæ¬
- ãã®ååãå«ãããã° (5件) ãè¦ã
次ã®ã¢ããã³ãã«ã¬ã³ãã¼ãããã㯠@koemu ããã§ãã
enjoy!