Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
ã¯ããã« ä»æ´ãªãã capistrano ã«æåããã®ã§ã¤ã³ãã©ã¨ã³ã¸ã¤ãªãã®è¦ç¹ã§è§¦ã£ã¦ã¿ã¦ä½¿ãæ¹ãã¾ã¨ãã¦ã¿ãã capistrano ã¨ã¯ 以ä¸ã¯èªåãæ±ã capistrano ã¸ã®ã¤ã¡ã¼ã¸ã è¤æ°ã®ãã¼ãã«å¯¾ãã¦ä¸¦åãã¦ã³ãã³ããå®è¡åºæ¥ãï¼ï¼ããããã¤ã³ãï¼ ã³ãã³ãã task ã¨ããåä½ã§çºãã¦èªåååºæ¥ãï¼ï¼ããããã¤ã³ãï¼ Ruby 製ã®ãããã¤ãã¼ã«ï¼ï¼ãããããããã¤ã³ã*1ï¼ ããã ããããããã¤ã³ãããããã°è¤æ°å°ã®ãµã¼ãã¼ã«ãã°ã¤ã³ãã¦è²ã ã¨ãããªãããããªãã¤ã³ãã©ã¨ã³ã¸ã¤ã使ããªãçç±ãç¡ãã§ããï¼ã¨ãããã¨ã§æ©é使ã£ã¦ã¿ãã¼ã ã¡ãªã¿ã«ä»ã¾ã§ã¯ä»¥ä¸ã®ãããªã¤ã¡ã¼ã¸ã ã¡ã³ããã³ã¹ä½æ¥çã« capistrano ã常ç¨ããããã«ãªã£ã¦ããã®ã¤ã¡ã¼ã¸ã ã¨ãããã¨ã§ãæ¬æ¥ã® capistrano ã®å©ç¨ç®çã¨ã¯é¸ãã¦ãã¾ããããããªãããã¤ã³ãã©ã¨ã³ã¸ãã¤
ãã£ã¨ã·ã³ãã«ã«ã§ããããæ¹ãããã°æãã¦ãã ããã¾ãï¼ chefãåããã¦ããCapistranoã®ãã°ããããªã«ããå¿ è¦ããã æ¨æºåºåã¨ãã¡ã¤ã«åºåã®ä¸¡æ¹ã«åºåãããã¨ã¯ã§ããªãããªã¨æªæ¦è¦éããè¨é²ã«ãªãã¾ãã - åè capturing output to log file require 'capistrano' require 'capistrano/logger' output = '/var/log/capistrano.log' custom_logger = Capistrano::Logger.new(:output => output) custom_logger.level = Capistrano::Logger::TRACE self.logger = custom_logger ã¾ãããã¡ãã®è¨å®ã§æ¨æºåºåã¯è¡ããããã¡ã¤ã«åºåããããã¨ã確èªã ã§ã¯å
jetsadabet à¹à¸§à¹à¸à¹à¸à¸à¹à¸à¸à¸à¹à¸£à¸²à¹à¸à¹à¸à¸à¸µà¹à¸¢à¸à¸¡à¸£à¸±à¸à¹à¸¥à¸°à¹à¸à¹à¸£à¸±à¸à¸à¸²à¸£à¸£à¸±à¸à¸£à¸à¸à¸§à¹à¸²à¹à¸à¹à¸à¸à¸µà¹à¸à¸µà¸à¸µà¹à¸ªà¸¸à¸à¹à¸à¸à¸²à¸£à¹à¸¥à¹à¸à¸à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¹à¸à¸à¸£à¸°à¹à¸à¸¨à¹à¸à¸¢. ระà¸à¸à¸à¸²à¸£à¹à¸à¸´à¸à¹à¸¥à¸°à¸à¸²à¸£à¹à¸¥à¹à¸à¸à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸µà¹à¸¡à¸±à¹à¸à¸à¸à¹à¸¥à¸°à¸à¸¥à¸à¸à¸ ัย สรà¹à¸²à¸à¸à¸§à¸²à¸¡à¹à¸à¸·à¹à¸à¸à¸·à¸à¹à¸¥à¸°à¸à¸§à¸²à¸¡à¹à¸à¹à¸à¸ªà¹à¸§à¸à¸à¸±à¸§à¸à¸µà¹à¸à¸¸à¹à¸¡à¸à¹à¸²à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸¹à¹à¹à¸¥à¹à¸à¸à¸¸à¸à¸£à¸°à¸à¸±à¸à¹à¸à¸£à¸°à¸à¸±à¸à¹à¸à¸µà¸¢à¸§à¸à¸±à¸. à¹à¸à¹à¸²à¸£à¹à¸§à¸¡à¸à¸²à¸£à¹à¸à¸´à¸¡à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸±à¸à¸à¸²à¸à¹à¸£à¸²à¹à¸à¸·à¹à¸à¸à¸§à¸²à¸¡à¸ªà¸à¸¸à¸à¸ªà¸à¸²à¸à¹à¸¥à¸°à¸à¸£à¸°à¸ªà¸à¸à¸²à¸£à¸à¹à¸à¸µà¹à¸«à¸¥à¸²à¸à¸«à¸¥à¸²à¸¢à¸à¸±à¸à¸ªà¸¡à¸±à¸¢à¸à¸µà¹à¸ªà¸¸à¸à¸à¹à¸°! à¹à¸à¸©à¸à¸² à¹à¸à¸ à¹à¸¡à¸·à¹à¸à¸à¹à¸²à¸à¸¡à¸µà¸à¸²à¸£à¹à¸¥à¹à¸à¸à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸¢à¹à¸²à¸à¸£à¸°à¸¡à¸±à¸à¸£à¸°à¸§à¸±à¸ à¸à¹à¸²à¸à¸ªà¸²à¸¡à¸²à¸£à¸
Railsã¢ããªã®ãããã¤ãã¼ã«ã¨ãã¦ããã¡ã¯ãã¹ã¿ã³ãã¼ãçãªä½ç½®ã«ããCapistranoã«ã¤ãã¦ã TL;DR HOSTSã¨ROLESã§ã¯ãªããHOSTFILTERã¨HOSTROLEFILTERã使ãã ã¿ã¹ã¯ã®å®è¡å å¶éæ¹æ³ Capistranoã¯ããããã¤å ãµã¼ãã«"ãã¼ã«"ãè¨å®ããç¹å®ã®ãã¼ã«ã«æå±ãããµã¼ãå ¨ã¦ã«å¯¾ãã¦ä¸æ¬ã§ãªã«ãããã®å¦çãå®è¡ããããã¨ãã§ããã # deploy.rb server 'webserver1' :web server 'webserver2' :web server 'dbserver', :db, :primary => true ... task :do_something, :roles => :web do ... end cap do_something #=> webserver1, webserver2ã«å¯¾ãã¦ã®ã¿do_so
2013 å¹´ 6 æé ã« capistrano ã®ãã¼ã¸ã§ã³ 3 ããªãªã¼ã¹ããã¾ãããããªãä¹ ãã¶ãã®ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ããã§è²ã å¤ãã£ã¦ããããã§ãã Intobox ã§ããããã¤ã«ã¯ capistrano ã使ã£ã¦ãã¦ãä»å capistrano ã®ãã¼ã¸ã§ã³ã¢ããããã¾ããã®ã§æé ã®ç´¹ä»ã¨ããã£ããã¨ãªã©ãã¾ã¨ãããã¨æãã¾ãã capistrano v3 capistrano v3 ã¯ãããè¯ãã¢ã¸ã¥ã¼ã«åãããç°¡åãªãããã°ãããé«éãªãããã¤ããªã©ãè¨è¨ç®æ¨ã¨ãã¦æ²ãã¦ãã¾ãã å¤æ´ç¹ãå¤ãã®ã§ã¢ããã°ã¬ã¼ãã¬ã¤ããå ¬å¼ãµã¤ãããæä¾ããã¦ãã¾ããåºæ¬çã«ã¯ãããè¦ãªããé²ãã¦ããã®ã§ããããããã¨ã¨ããã° Gemfile ã« gem 'capistrano', '~> 3.0' ã追å bundle install bundle exec cap install ããã£ã¦
Capistranoã便å©ã§ãããã capistrano/capistrano æè¿ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ããããã£ãã®ã§ããã使ãæ¹ãã¨ãããã¹ã¯ãªããã®æ¸ãæ¹ããä½æ³ãå¤ããããCapistrano 3ã«ã¢ãããã¼ãããã¯ãããã©å ¨ç¶åããªãã¦ã©ããªã£ã¦ãã ãã¨ããæµãã¯ãã¯ããç´æã¿ããã§ãã 試ãã«åãå人ã§ä½ã£ã¦ãã¦ã§ããµã¤ãã®Capistranoãã¢ãããã¼ããã¦ã¿ãã®ã§ããã®ä¸ã§ãããªã¨ããã«æ°ãä»ããããªãã¨æããã¤ã³ãã§ãæ¸ãã¦ããã¾ãã capifyã¯ä½¿ããªã Capistranoã使ãã¨ãã¯$ bundle installããã次ã«$ bundle exec capify .ã¨ããã®ããç´æã®æµãã§ãããããããã¯capifyã使ã£ã¦ãcap installã使ã£ã¦ãã¨è¨ããã¾ãã ã§ãã®ã§: $ bundle exec cap installã¨ãã¾ãããã ãã«ãã¹
ã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ãèªååãã¹ããªã®ã¯è¨ãã¾ã§ããªããã¨ã§ãã ä¸å¿æåã§ãããã¤ãè¡ãå ´åã®åé¡ç¹ã«ã¤ãã¦æ´çãã¦ããã¨ä»¥ä¸ã«ãªãã¾ãã ããã¸ã§ã¯ãã®æéä¸ããã¦éç¨ã«å ¥ã£ã¦ãããä½åº¦ãæã§ãããã¤ããã¨ãããã¨ã¯ã¨ã¦ã¤ããªãå¤ãã®æéãæä½æ¥ã«è²»ãããã¨ã«ãªããããã¤å ã®ç°å¢ã®æ°ãå¤ããªãã°ãªãã»ã©ä½æ¥ã®æéãå¢ããæä½æ¥ã§ä½æ¥ããã¨ééãããããç¹ã«æé ãè¤éã ã£ããç°å¢ãå¤ãã£ããããã¨ç¢ºçã¯é£èºçã«ããããããããã¤ããã¢ããªã±ã¼ã·ã§ã³ã«åé¡ããã£ã¦ããã«æ»ããªããã°ãªããªãå ´åã«å¤ãã®æéãããããå ´åã«ãã£ã¦ã¯ãã¸ãã¹ä¸ã®æ©ä¼æ失ã«ç¹ããæ¬æ¥ã¯ä¾¡å¤ãçããã£ã¼ãã£ã¼ãå®è£ ãããã¨ã«æéãããããã¯ããããããããã¨ããã£ã¦ããã¨ã©ãã©ãæéããªããªã£ã¦ããã¾ããã¾ãæä½æ¥ã®ãªã¹ã¯ãæ¶è²»ãããæéãæãã¦ãããã¤ã®åæ°ãæ¸ããã¦ãã¾ãã®ã¯ããã¸ãã¹å´ããã¿ãã¨ç´å¾ãã
ã¯ããã« ãã®è¨äºã¯GREE Advent Calendar 2013å¹´ã®21æ¥ç®ã§ããã楽ãã¿ãã ããï¼ ããã«ã¡ã¯ãã¢ã´ã²ãããã³ãã£ã¼ã ã¨è©å¤ã®ä¹å²¡ã§ããGREEã§ã¯ãJavaãScalaãå¸æããããã®åå°ãåºããããããããã¤ãç£è¦ã®ä»çµã¿ã¥ãããªã©ã横æçã«ãã£ã¦ãã¾ããä»åã¯ãã®éç¨ã§å¾ãããç¥èããCapistrano 3ã®å ¥éè¨äºãã¨ããå½¢ã§å ±æããã¦ããã ãã¾ãã ãã®è¨äºã§ã¯Capistrano 3ã®åºç¤ããç´¹ä»ãã¾ããCapistrano 3ã¯Rubyããã¼ã¹ã«ãããµã¼ãæä½ããã³ãããã¤ã®èªååãã¼ã«ã§ããCapistrano 3ãå©ç¨ãããã¨ã§ããããã¤ãªã©ã®è¤éãªãµã¼ãæä½ãèªååãããã¨ãã§ãã¾ããããã®è¨äºã§ã¯ãç¹ã«ãããã¤ã«ç¦ç¹ããã¦ãªãããCapistranoã§ãµã¼ãæä½ãèªååããèãæ¹ã¨å®ç¾æ¹æ³ãã説æãã¦ããã¾ãã Capistrano 3ã®ç¿å¾
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}