GitHub æ代ã®ãããã¤æ¦ç¥
å°ãåã¾ã§ã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ã¨è¨ãã° capistrano ãªã©ãã³ãã³ãã©ã¤ã³ããå©ãã¦ãããã¤ãã¿ãããªãã¨ããã£ã¦ããããæè¿ã¯å°ãæ§åãéãã®ã§ãã®ããæ¹ãKAIZEN platform Inc. ã§ã®äºä¾ãç´¹ä»ããã
GitHub ã®ã¤ãã³ããå¥æ©ã« CI as a Service ã«ãããã¤ãæ å½ããã
GitHub 㧠Pull Request ãéã£ã¦éçºããã®ãåæã«ãªã£ã¦ããã®ã¯ä»¥åã«ãç´¹ä»ããã
æè¿ã¯ Travis CI ã CircleCI ãªã©ã«ä»£è¡¨ããã CI (Continuous Integration) as a Service ããã£ã¦ãCI ãèªåãã¡ã§ç°å¢ãæ§ç¯ããªãã¦ãã¯ã©ã¦ãã«ä»»ãããã¨ãã§ãããKAIZEN ã§ã¯ CircleCI ãç©æ¥µçã«ä½¿ã£ã¦ããã
ãããã® CI as a Service ã¯åºæ¬çã« GitHub ã¨é£æºãããã¨ãåæã«ãªã£ã¦ã¦ãGithub ã«å·®åã push ããã¨ãããå¥æ©ã«ã¤ã³ãã°ã¬ã¼ã·ã§ã³ãã¹ããå®è¡ãã¦ããããããã
ã§ãCI ã¨ããæèã§ããã¨ãã®èªåãã¹ãã®å®è¡ã主ãªã¦ã¼ã¹ã±ã¼ã¹ã¨ãã¦æ³åãããããã®ã ãã©ãCI as a Service ã«ã¯ãã®ãã¹ãã®å®è¡ãçµãã£ããã¨ã®ããªããªã¼ã®æ©è½ãããã
Deployment - Travis CI ãªãããè¦ãã¨ããããã®ã ãã©ãmaster ã« push ãããããããã£ããã« Heroku ã«ãããã¤ãè¡ãã¨ãããããããã¨ãã§ããã
CircleCI ã®ãããã¤ãªãã·ã§ã³
ãã® CI as a Serivice ã®ãããã¤ãªãã·ã§ã³ã¯çµæ§è²ã ç´°ããè¨å®ã§ãã¦ãä¾ãã°ãdeployment/production ã¨ããååã®ãã©ã³ãã«å¤æ´ã push ãããããããå®è¡ããããªãã¦è¨å®ãã§ããã
è¨å®ã¯ã¬ãã¸ããªã«ç½®ãã circle.yml ãã¡ã¤ã«ã«è¨è¿°ãããä¾ãã°ä»¥ä¸ã®ãããªæãã
deployment: production: branch: deployment/production commands: - ./script/assets_precompile.sh: - bundle exec cap production deploy:migrations: edge: branch: deployment/edge commands: - ./script/assets_precompile.sh: - bundle exec cap edge deploy:migrations:
ããã§ãªã¢ã¼ãã® deployment/production ãã©ã³ãã«ã³ã¼ãã push ããã¨ãããå¥æ©ã« production ã¸ãããã¤ãè¡ãããããdeployment/edge ãªã edge ã¸ãã¦ãªæãã«ãªãã
å®éã®ãããã¤ã¯ã(ã¾ã Mutable Infrastructure ãªã®ã§) capistrano ãå®è¡ãã¦ããã
CircleCI ã«ãããã¤ãå®æ½ãããã¨ããã¹ããå®è¡ãã¦ãã®çµæãç·ã ã£ãããããã¤ãããã¨ãããããªãã¨ã¨ãããããã¤ã®ãã°ãå ±æãããããªãã¨ãããã£ã³ã»ã«ãç°¡åã¨ãããããªã¡ãªããã享åã§ããã
Pull Request ã§ãããã¤ãã
ãã»ãã»ãããªãã»ã©ãããããããã¤ãããã¨ã㯠master ãã deployment/production 㸠merge ãã¦ãgit push ããã®ããã¨ããã¨ããã ãã©ãããã§ããä¸å工夫ããã
ãããã¤ããããªã£ãããmaster ãã deployment/production 㸠Pull Request ãä½ããã§ããã
ãã® Pull Request ã merge ããã¨ãCircleCI ããããæ¤ç¥ãã¦çµæçã« CircleCI ä¸ã§ãããã¤ãèµ°ãããã£ã³ã»ã«ãããã¨ã㯠merge ããªã㧠close ããã
ãªãã§ç´æ¥ push ããã«ãããã Pull Request ã«ãããã¯ãä¸ã®ç»é¢ãè¦ãã°ã ãããããããã®ã¨ãã
- ãããã¤ã®è¦ããå
- ä½ããããã¤ããããã®ã³ããããã°ã®å¯è¦å
ãªã©æ¬å½ã«ããããªå©ç¹ãããã
production ãããã¤ã®éã«ã¯ããã® Pull Request ã®ã¹ã¬ããã使ã£ã¦ QA ã®æçµç¢ºèªãããããããã³ãã¥ãã±ã¼ã·ã§ã³ã Pull Request ä¸ã«éç´ããããã¨ã«ãªããããããã¤ç´åã® hotfix ãè¡ãããã³ããããªãããå ¨ã¦è¦ããããã«ãªãã
ä»æãã¨ãæå ã§ã¨ã¤ã¤ã§ cap deploy ã®æã¯ããã®ãããã®ã¯ã¼ã¯ããã¼ãå ¨é¨æé»ç¥åãã¦ãããã¢ããªã±ã¼ã·ã§ã³ã¸ã®å¤æ´ã Pull Request ãã¼ã¹ã«ãã¦è²ããªãã®ãè¦ããããã«ãªãã®ã¨åãã§ããããã¤ãã¾ã Pull Request ã§æ¹åã§ããã¨ãããããããããã
hubot ã¸ãããã¤ããé¡ããã
ä»ä¸ãã¯ããã® Pull Request ãä½ãæ¹æ³ã§ãããã¤ãå æ¥ã¾ã§ã¯ Pull Request ã GitHub ä¸ã§ããã¥ã¢ã«ã§ä½ã£ã¦ããããããã¾ã§ããã GitHub API ã使ã£ã¦ Pull Request ä½æã¯èªååãã¦ãã¾ãã°ãã
ããã¦ãæ¥é HipChat ã使ã£ã¦ãã®ã ããããã£ããä¸ã§ hubot ã«ãããã¤ããé¡ãããã Pull Request ãä½ã£ã¦ããããã¨ããã°ããããã¤å§ãã¾ã¼ããã¿ãããªå®£è¨ãããã§ä¸ç³äºé³¥ã§ããã
ã¨ããããã§ä½ã£ãã
hubot ã«ãé¡ãããã¨ãããã¤ç¨ Pull Requet ãä½ããã¦ãCircleCI ããããã¤ãã¦ãããããããªã¯ã¼ã¯ããã¼ãã§ãããã£ããä¸æ³ã
GitHub ã * as a Service ãåæã«ããã¯ã¼ã¯ããã¼ã®æ代
GitHub ã CircleCI ã®ãããªãµã¼ãã¹ãããã¨ããåæã§ã¯ã¼ã¯ããã¼ãæ§ç¯ãã¦ããã¨ãããªæãã§å·¥å¤«æ¬¡ç¬¬ã§ããããé¢ç½ãã§ãããWeb ãµã¼ãã¹ã¨ Web ãµã¼ãã¹ãç¹ãã¦ãããã«ããã«èªåãã¡ã®éçºããã¼ãçµã¿è¾¼ãã§ä¸ã¤ã®ããã¼ã¨ãã¦å®æããã¨ããªããªãã«ç½å¿«ã§ããã
ãã®è¾ºã®éçºã¯ããããããã£ãWebãµã¼ãã¹ã®ãããªãä¸è¦ããã¨ããã°ã©ã é¨åã¨ãã¦ã¯è¦ããªããããªãã®ãã®ããéçºã®ããã®ä¸ã¤ã®ããã°ã©ããã«ãªé¨åã§ããã¨èªèã§ãããã©ãããã©ã¤ãã©ãªããã¬ã¼ã ã¯ã¼ã¯ã¨åãé¡ã®ãã®ã§ããã¨ãã©ããã«è¦ãããã©ããããããæè¦ãè¦æ±ãããããã«æãã
ãã㯠Web 2.0 㧠Web API ã ãªãã ã¨è¨ããã¦ãããããããã£ããã¨ãªã®ã ããã©ãããã®æè¦ããããã³ãã¨ã³ãã ãã§ã¯ãªãã¦ããããã¦éçºããã»ã¹ã®ã¯ã¼ã¯ããã¼ã®çµã¿ä¸ãã«ã«ãé©ç¨ã§ããããã«ãªã£ãã¨ããã®ããèªåã¨ãã¦ã¯æ¨ä»ãã®é åãé¢ç½ãæããçç±ã®ã²ã¨ã¤ã§ãããã
éã«è¨ãã°ãããããé åã«éçºãªã½ã¼ã¹ããã¾ãç¶ç¶çã«æè³ã§ãããã©ããã¨ãããã¨ãä»å¾ã®éçºçµç¹ã®ããæ¹ã¨ãã¦éè¦ãªè¦ç´ ã ã¨æã£ã¦ãã¦ãKAIZEN ã§ã¯ä¼ç¤¾ãç«ã¡ä¸ãã£ãå½åãã CTO ã¨è©±ã㦠"Developer Productivity" ã¨ããããã®æã®ä»äºãããã·ã§ã³ã«ãããã¼ã ãæ§æããããã«ãã¦ãã¦ããã®å½¢ãåºã¾ã£ã¦ããã¨ããããããããããå½¢ã§é¢ç½ãææã«ç¹ãã£ã¦ãããã¨æã£ã¦ããã