ã¤ã³ãã©ã¹ãã©ã¯ãã£ã¼é¨ã®å®®ä¸ï¼@gosukenatorï¼ã§ãã
ã¯ãã¯ãããã§ã¯ä¸é¨ã®ãµã¼ã㧠Ubuntu ã使ãå§ãã¦ããã apt ãªãã¸ããªãã©ã®ããã«ç®¡çããã®ãè¯ãã®ãã試è¡é¯èª¤ãã¦ãã¾ããaptãªãã¸ããªç®¡çã§å®ç¾ããããã¨ã¯ã主ã«æ¬¡ã®2ç¹ã§ãã
- èªåã§ãã«ãããããã±ã¼ã¸ã®ç®¡ç
- ãªã¢ã¼ããªãã¸ããªããåé¤ãããæ§ãã¼ã¸ã§ã³ããã±ã¼ã¸ã®ä¿å ¨
ãã®ããããããæãã«ã§ãããã¼ã«ã¯ãªãããªãã¨ç¤¾å ã§è©±ãã¦ããã¨ãããã«ã«ãçç¼ãç ã«æãã¦ããã£ãã®ã aptly ã§ãã
aptly ã¨ã¯
å ¬å¼ãµã¤ãã«ãaptly is a swiss army knife for Debian repository managementãã¨ããããã«ãaptly ã¯å¤æ©è½ãª apt ãªãã¸ããªç®¡çç¨ãã¼ã«ã§ããå¤é¨ãªãã¸ããªã®ãã©ã¼ä½æããã¼ã«ã«ãªãã¸ããªã®ä½æããªãã¸ããªã®ã¹ãããã·ã§ããä½æãã¹ãããã·ã§ããå士ã®ãã¼ã¸ãS3 ã¸ã® publish çã®æ©è½ãããã¾ãããswiss army knifeãã¨è¬³ã£ã¦ãã®ã¯ä¼éã§ã¯ãªããããªãå¤æ©è½ã§ãã¼ã«ã®å ¨ä½åãã¤ãã¿ã«ããã®ã§ããããªãã£ã·ã£ã«ãµã¤ãã® Overview ã«ããããããå³ãªã©ãããã®ã§ããã¡ããåç §ãã¦ãã ããã
詳ãã使ãæ¹çã¯ããã§ã¯è§£èª¬ãã¾ããããèå³ã®ããæ¹ã¯ Tutorial ãããã©ã¤ãã¦ã¿ãã¨è¯ãã§ãããã
aptly ã§ãããã¨ãã¦ãããã¨
ç¾å¨ aptly ãå©ç¨ãã¦ã以ä¸ã®ãã¨ãå®ç¾ãããã¨ãã¦ãã¾ãã
- èªåããã±ã¼ã¸ç®¡çç¨ã®ãã¼ã«ã«ãªãã¸ããªã®éç¨
- ãªã¢ã¼ããªãã¸ããªã®ãã©ã¼ä½æã¨ãã¹ãããã·ã§ãããæ¯æ¥ä¿åãã¦ãªã¢ã¼ãããåé¤ãããããã±ã¼ã¸ãä¿å ¨
- ãã¼ã«ã«ãªãã¸ããªã¨ãªã¢ã¼ããã©ã¼ã®ã¹ãããã·ã§ããããã¼ã¸ã㦠S3 㸠publish
å³ã«ããã¨ä»¥ä¸ã®ãããªã¤ã¡ã¼ã¸ã§ãã
ãã¼ã«ã«ãªãã¸ããªã®éç¨
ãã¼ã«ã«ãªãã¸ããªã¯æ¬¡ã®ããã«ä½æãã¾ãã
$ aptly repo create cookpad-repo
ãã¼ã«ã«ãªãã¸ããªã«ããã±ã¼ã¸ã追å ããã«ã¯æ¬¡ã®ããã«å®è¡ãã¾ãã
$ aptly repo add cookpad-repo package.deb
ãªã¢ã¼ããªãã©ã¼ä½æã¨ã¹ãããã·ã§ããä½æ
ãªã¢ã¼ããªãã¸ããªã®ãã©ã¼ã¯æ¬¡ã®ããã«ä½æãã¾ãã
$ aptly mirror create -architectures=amd64 ubuntu-mirror \ http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty
ãªã¢ã¼ããªãã¸ããªã¨ãã©ã¼ãåæããã«ã¯ã次ã®ããã«å®è¡ãã¾ãã
$ aptly mirror update ubuntu-mirror
aptly mirror update
ãå®è¡ããã¨ããªã¢ã¼ããªãã¸ããªã¨å®å
¨ã«åæãããããããªã¢ã¼ãã§åé¤ãããããã±ã¼ã¸ã¯ãã©ã¼ã§ãåé¤ããã¦ãã¾ãã¾ãããªã¢ã¼ãã§åé¤ããã¦ãæå
ã«æ®ããããã¹ãããã·ã§ãããä½æãã¾ãã
$ aptly snapshot create ubuntu-mirror-20141106 from mirror ubuntu-mirror
æ¯æ¥ã¹ãããã·ã§ãããåå¾ãããã¨ã§ããªã¢ã¼ãã§åé¤ãããããã±ã¼ã¸ã®ä¿å ¨ãè¡ãã¾ãã
ãã¼ã«ã«ãªãã¸ããªã¨ãªã¢ã¼ããã©ã¼ã®ãã¼ã¸
ãã¼ã«ã«ãªãã¸ããªã¨ãªã¢ã¼ããã©ã¼ããã¼ã¸ããããã«ããã¼ã«ã«ãªãã¸ããªã®ã¹ãããã·ã§ãããåå¾ãã¾ãã
$ aptly snapshot create cookpad-repo-20141106 from repo cookpad-repo
ãã¼ã«ã«ãªãã¸ããªã®ã¹ãããã·ã§ããã¨ããªã¢ã¼ããã©ã¼ã®ã¹ãããã·ã§ããããã¼ã¸ããã¹ãããã·ã§ãããä½æãã¾ãããªã¢ã¼ãã§åé¤ãããããã±ã¼ã¸ããã¹ã¦å«ããããããªã¢ã¼ããã©ã¼ããåå¾ããã¹ãããã·ã§ãããã¹ã¦ããã¼ã¸å¯¾è±¡ã«å«ãã¾ãããã¼ã«ã«ãªãã¸ããªã®ããã±ã¼ã¸ã¯åºæ¬çã«åé¤ããªãã®ã§ãææ°ã®ã¹ãããã·ã§ããã®ã¿ãã¼ã¸å¯¾è±¡ã«å«ãã¾ãã
aptly snapshot merge --no-remove merged-snapshot-20141106 cookpad-repo-20141106 \ ubuntu-mirror-20141106 ubuntu-mirror-20141105 ubuntu-mirror-20141104
ãã¼ã¸ããã¹ãããã·ã§ããã S3 㸠publish
ãã¼ã¸ããã¹ãããã·ã§ããã publish ãã¾ããåã㦠publish ããå ´åã¯aptly publish snapshot
ãå®è¡ãã¾ãã
$ aptly publish snapshot merged-snapshot-20141106 s3:cookpad:
2度ç®ä»¥é㯠aptly publish switch
ãå®è¡ãã¾ãã
$ aptly publish switch trusty s3:cookpad: merged-snapshot-20141106
åé¡ç¹
ãã®æ¹æ³ã®åé¡ç¹ã¯ãpublish switch
å®è¡æã«ãå·®åã§ã¯ãªããã¹ã¦ã®ããã±ã¼ã¸ãã¢ãããã¼ããããããé常ã«æéãããããã¨ãããã¨ã§ããç¹ã«ãUbuntu ã®ããã±ã¼ã¸ã¢ã¼ã«ã¤ãããã¹ã¦ãã©ã¼ãã¦ããã¨ã4ä¸å以ä¸ã®ããã±ã¼ã¸ãã¢ãããã¼ããããã¨ã«ãªããEC2ã¤ã³ã¹ã¿ã³ã¹ããS3ã¸ã®è»¢éã«2æé以ä¸æéããããã¾ããããããéä¸ã§ãããã¯ã¼ã¯ã¨ã©ã¼çã§ä¸æãããã¨ãæåããããç´ãã«ãªã£ã¦ãã¾ãã¾ãã
ãããã£ã¦ããã®æ¹æ³ã¯ç¾å®çã§ãªããããä»ã®æ¹æ³ã模索ä¸ã§ããç§ã aptly ã®æ©è½ããã¹ã¦ææ¡ã§ãã¦ããããä»ã«ããæ¹æ³ãããã®ã«è¦ã¤ãããã¦ããªãå¯è½æ§ããããããç¾å¨ããã¥ã¡ã³ããèªã¿æ¼ã£ã¦ãã¾ããaptly ãã¾ã ãã¼ã¸ã§ã³ 0.8 ãªã®ã§ãä»å¾ã®ãã¼ã¸ã§ã³ã¢ããã§ããæãã«è§£æ±ºã§ããããã«ãªãããããã¾ããã
ããä»ã«ããæ¹æ³ããããã¼ã«ãªã©ããã¾ãããããã²æãã¦ãã ããã