Jenkins ã¦ã¼ã¶ã»ã«ã³ãã¡ã¬ã³ã¹ 2015 æ±äº¬ â ã»ãã·ã§ã³
Ansible Meetup in Tokyo 2014.09
serverspecã¨docker-apiã§DockerfileãTDD ããã¤ãDockerfileãæ¸ãã¦ããï¼ä»æ¸ãã¦ããDockerfileã¯çãã¦ã·ã³ãã«ãªãã®ã°ããã ãï¼ãã£ã¨é·ãè¤éåããæã«ä¸å®ã«ãªãããã ï¼ä¸å®ã解æ¶ããã«ã¯ãã¹ããããªãï¼ããã«ãã¹ãé§åçã«Dockerã¤ã¡ã¼ã¸ãéçºã§ãããç´ æµã ï¼ã¤ã¾ãï¼ ãã¹ããæ¸ã Dockerã¤ã¡ã¼ã¸ãä½æãã¦ï¼ãã¹ãã®å®è¡ -> RED Dockerfileã®ç·¨é Dockerã¤ã¡ã¼ã¸ãä½æãã¦ï¼ãã¹ãã®å®è¡ -> GREEN ãã¹ãã⦠ã®æµããã§ããã¨ããï¼ ã¨ãããã¨ã§ï¼RSpecã使ã£ã¦TDDã§Dockerfileãéçºããã¨ããã®ããã£ã¦ã¿ãï¼tcnksm/docker-rspecï¼ä»åå®ç¾ããã®ã¯ä»¥ä¸ï¼ Docker Remote APIã§Dockerfileç¹æã®ã³ãã³ã(e.g, CMDãEXPOSE)ã®RSp
æè¿ã¯æ å½ã·ã¹ãã ãå¹³åã ãã©ä¿ºãå¹³åãããªããç²ãã¦ããå¿å¹´ä¼ã®é£ãã£ã³ããã£ã¤ããã·ã«ãªã£ã¡ã¾ã£ããä¼ç¤¾ã®å¶åº¦ã§1é±éãããä¼ã¿ãã¨ããã®ã§ãä¸äººã§æ¸©æ³ã¨ã¹ããã¨éçºå宿ã§ããã«åæµ·éã«ã§ãè¡ããããªã£ã¦æã£ã¦ãã1æã2æãããã«ã ãã¼ã¨ãæ å½ãã¦ãããµã¼ãã¹ã«serverspecãå°å ¥ãããããã«ããã£ã¦ãã¹ãé ç®ãèããã®ã§è»½ãã¾ã¨ããããã¡ããserverspecå°å ¥åããµã¼ãæ§ç¯å¾ã¯åä½ç¢ºèªã¨ãããããã¹ãããããã¨ã¯ãã¦ããã£ã¡ããã¦ãããã ãã©ããã¹ãé ç®ãã¾ã¨ãã«èããã®ã¯ãããåãã¦ãããããªããserverspecã®ãã¼ã¸ã§ã³ã¯0.13.2ã§ãããRubyã¯2.0.0ã 0. ç°å¢ ä¸è¨ã®ãããªç°å¢ã«å°å ¥ããããããµããæ§æã ã¨æãã60å°ãããã®è¦æ¨¡ãDBã¯ãã¹ã¿3å°ã«åå²ããã¦ãã¦ãããããã«ã¹ã¬ã¼ããnå°ã¶ãããã£ã¦ãããLBã®ç®±ã¯äºã¤ããããç©ççã«ã¯1å°
ã¯ããã« ããã«ã¡ã¯æ¤æ¨å樹ã§ããç¸å¤ãããCloudFormationã¨Chefãªæ¯æ¥ãéã£ã¦ãã¾ãããã®ãããã§ãæè¿ã¯å®é¨ç¨ãµã¼ããè¨å®ããã¨ãã«ã極åæä½æ¥ã¯ãªãããCloudFormationãChefã使ã£ã¦èªååã»çååããç¿æ £ãã¤ãã¾ããã以åä½ã£ãCookbookã使ç¨ãã¦ãã³ãã³ã1ã¤ã§æ°ç°å¢ãæ§ç¯ãããã¨ãã£ã¦æ°åããã§ãããã ãã¦Chefã®Cookbookãå¢ãã¦ãã¦å¾ã ã«åå©ç¨ãé²ãã§ã¯ããã®ã§ãããCookbookãä½æãã¦ããæ°é±éãããã¨ãæ¬å½ã«ãã®ã¯ãã¯ããã¯ã¯ã¾ã åãã®ããªï¼ãã¨ä¸å®ã«ãªã£ã¦ãã¾ããããã¯ãã¯ããCookbookãæ£ããé©ç¨ããããã¨ãç¶ç¶ãã¦ä¿è¨¼ããä»çµã¿ãã»ããã¨ããã§ãã æ¬æ¥ã¯Chef Cookbookã®ãã¹ãèªååã®ä¸ä¾ã¨ãã¦ãJenkinsããEC2ãèµ·åãã¦ããchef-soloã使ã£ã¦Cookbooksãé©ç¨ãããã®å¾s
tily/chef-serverspec-handler · GitHub ãChef ã®ã¬ã·ãã¯ãããããã¹ãããè¨è¿°ãããã®ã ãããã¬ã·ããããã¹ããèªåçæã§ããã¹ãã ããªãã¨ãã£ã¨æã£ã¦ãããã ãã©ãæè¿è§¦ãã¯ããã serverspec ãã·ã³ãã«ã§ç°¡åã«èªåçæã§ããããªã®ã§ãã£ã¦ã¿ãã 使ãæ¹ã¯ä¸è¨ãªã³ã¯ã«æ¸ãã¦ããéããªã®ã§ããããã¨ãã° Chef ã®ã¬ã·ãã«ããæ¸ãã¦ãããã¤ãã template '/var/tmp/template.txt' do source 'template.txt.erb' mode 0777 owner 'root' group 'root' variables(:val1 => 'val1', :val2 => 'val2', :val3 => 'val3') action :create end ãã®ãã㪠serverspec ã®ãã¹ã
æ¨æ© Jenkins 㨠Vagrant 㧠CI ã ãã¨æ¸ããã ã¨ããåå¿ããã£ãã確ãã«ãå¯è½ãªãç©çãµã¼ãã«ä¾åããªãå½¢ã§ãã¹ãã§ããã¨ããå¬ããå ´é¢ãããããã§ããã ããããã㯠VagrantãVagrant ã¯ãã¼ã¸ã§ã³ 1.1 ãããããã¯ã¨ã³ãã VirtualBox ã ãã§ãªã AWS (EC2) ãªã©ã® IaaS ãæå®ãã¦ä»®æ³ãµã¼ãã¼ãä½ã£ããå£ãããã§ããããã«ãªã£ã¦ãã¾ãã詳ãã㯠http://d.hatena.ne.jp/naoya/20130315/1363340698 ãã®è¾ºãããã®æ©è½ãå©ç¨ããã°æ¨æ¥ã® Jenkins + Vagrant ã®ããã¼ãã»ã¨ãã©å¤ããã«ãEC2 ã®ã¤ã³ã¹ã¿ã³ã¹ã§ã®ã¤ã³ãã°ã¬ã¼ã·ã§ã³ãã¹ããã§ãããã§ããã éè¦ããã¿ã¡ãã§ã¯ãæ©éãã£ã¦ããã¾ããããã Multi VM ã§ãã¼ã«ã«/ãªã¢ã¼ã両対å¿ã« ãã£ãããªã®ã§ Vi
Jenkins ããããã¨æ¯ãããã¨åæ¥ããã¾ããã£ãã®ã§åå¿é²ãæ®ãã¦ããã ããããã£ãã®ã¯ Chef ã§æ§ç¯ãããµã¼ãã¼ã Jenkins 㧠CI ãããã¨ãããã®ããã®ã¨ããµã¼ãã¼ã¯ãã¹ããçµãã度ã«ç ´æ£ãã¦ããã¹ãéå§æã«å度çã£æ°ãªç¶æ ããç«ã¡ä¸ãããã(ãããããµã¼ãã¼ãå£ãã¦ä½ã£ã¦ã¨ãããã¹ãã¯ãªãã¨ããååã§å¼ã°ããã®ã ãã?) ä»®æ³ãµã¼ãã¼ãç ´æ£/ä½æãããã°ã©ããã«ã«ããã®ã¯ãã¡ãã Vagrant ãããã¸ã§ãã³ã°ã¯ Chef Chef ã®ç°å¢ãæ´ããã®ã« knife-solo 0.3.0.pre3 ãã¹ã㯠serverspec ã³ã¼ã㯠Github ã«ä¸ãã (https://github.com/naoya/jenkins-vagrant-test) CI 㯠Jenkins ã¨ããæ§æã«ãªã£ã¦ãããã²ã¨ã¾ã Jenkins ã Vagrant ã¯ãã¼ã«ã«
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}