Capistrano3 ã§ããã©ã«ãã®ç°å¢ãæå®ãã
Capistrano3 ããã¯ãtask ã®å®è¡æã«ã¹ãã¼ã¸ãæå®ããªãã¨ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ãåºãããã«ãªãã¾ããã
# cap deploy Stage not set, please call something such as `cap production deploy`, where production is a stage you have defined.
capistrano-ext ãä¸è¦ã«ãªããããã©ã«ãã§è¤æ°ã®ç°å¢ãæ±ããããã«ãªã£ãçºã®å¤æ´ã®ããã§ãã
ããã¯ããã§ä¾¿å©ãªã®ã§ãããå¦çã«ãã£ã¦ã¯ã¹ãã¼ã¸ãåããå¿ è¦ã®ãªããã®ãããããã®å ´åã§ããã¡ãã¡æ示çã«æå®ããªããã°ãªããªãã®ã¯ã¡ãã£ã¨é¢åã§ããã
ã¨ããããã§ä½ãæ¹æ³ã¯ãªããæ¤ç´¢ãã¦ã¿ãã¨ãæ¢ã«è©¦ãã¦ããæ¹ããã¾ããã
Capistrano 3: Setting a Default Stage
http://dylanmarkow.com/blog/2014/01/08/capistrano-3-setting-a-default-stage/
以ä¸ã®ããã«ãããã¨ã§ããã©ã«ãã®ã¹ãã¼ã¸ãè¨å®ã§ããå®è¡æã®æå®ãçç¥ãããã¨ãã§ããããã«ãªãããã§ãã
Capfile ãç·¨éãã¾ãã
# vi Capfile
Capfile ã®æ«å°¾ã«ä»¥ä¸ã®äºè¡ã追è¨ãã¾ãã
ããã§ã¯ production ç°å¢ãããã©ã«ãã«ãã¾ããã
Rake::Task[:production].invoke invoke :production
ããã§ä»¥éã¯ãcap deployãã®ããã«ã¹ãã¼ã¸ãçç¥ãã¦ã config/deploy/production.rb ã®å 容ãèªã¿è¾¼ã¾ãå®è¡ãããããã«ãªãã¾ããã
ãã ããã®è¨å®ãå
¥ã£ã¦ããã¨ä»ã®ã¹ãã¼ã¸ãæå®ãã¦ã production.rb ã®å
容ãèªã¿è¾¼ã¾ãã¦ãã¾ããããªã®ã§ãä¸åº¦è¨å®ããå ´åã¯æ³¨æãå¿
è¦ããã§ãã
ãã®ãã¡ capistrano-ext ã®ããã«ãset :default_stage, "staging"ãã®ãããªæãã§æå®ã§ããããã«ãªã£ã¦æ¬²ããã§ããã