{"id":1671,"date":"2016-12-26T10:30:07","date_gmt":"2016-12-26T01:30:07","guid":{"rendered":"https:\/\/blog.ymyzk.com\/?p=1671"},"modified":"2017-12-08T12:04:40","modified_gmt":"2017-12-08T03:04:40","slug":"circleci-tex","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2016\/12\/circleci-tex\/","title":{"rendered":"CircleCI \u3067 LaTeX \u539f\u7a3f\u306e CI \u3092\u5b9f\u73fe\u3059\u308b"},"content":{"rendered":"
$latex \\LaTeX$ \u3092\u4f7f\u3063\u3066\u8ad6\u6587\u7b49\u306e\u539f\u7a3f\u3092\u66f8\u3044\u3066\u3044\u308b\u969b\u306b, \u8907\u6570\u4eba\u3067\u540c\u6642\u306b\u7de8\u96c6\u3057\u305f\u308a, \u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30df\u30c3\u30c8\u3057\u5fd8\u308c\u305f\u308a\u3057\u305f\u7d50\u679c, \u539f\u7a3f\u304c\u304d\u3061\u3093\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u306a\u304f\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059. \u3053\u306e\u8a18\u4e8b\u3067\u306f CircleCI \u3092\u7528\u3044\u3066 Git \u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3057\u3066\u3044\u308b $latex \\LaTeX$ \u539f\u7a3f\u306e\u7d99\u7d9a\u7684\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059.<\/p>\n
2017\/12\/8 \u8ffd\u8a18: \u3053\u306e\u8a18\u4e8b\u3067\u306f CircleCI 1.0 \u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\uff0eCircleCI 2.0 \u3092\u4f7f\u3063\u3066 CI \u3092\u884c\u3046\u300c\u8ad6\u6587\u57f7\u7b46\u3092\u652f\u3048\u308b\u7d99\u7d9a\u7684\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3: Git \u304b\u3089 Amazon S3 \u307e\u3067<\/a>\u300d\u3068\u3044\u3046\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u306e\u3067\uff0c\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u305d\u3061\u3089\u3082\u3054\u89a7\u4e0b\u3055\u3044\uff0e<\/p>\n <\/p>\n \u4eca\u56de\u306f CircleCI \u3067 $latex \\LaTeX$ \u306e\u539f\u7a3f\u304c\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u308b\u3053\u3068\u3092\u30c1\u30a7\u30c3\u30af\u3057, artifacts \u3068\u3057\u3066\u751f\u6210\u3055\u308c\u305f PDF \u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3092\u76ee\u6a19\u306b\u3057\u307e\u3059.<\/p>\n TeX Live \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7b49\u3092\u30ed\u30fc\u30ab\u30eb\u306e\u4f5c\u696d\u74b0\u5883\u3068\u63c3\u3048\u308b\u3053\u3068\u306f\u96e3\u3057\u3044\u305f\u3081, \u6700\u7d42\u7684\u306a\u539f\u7a3f\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u306f CI \u3067\u306f\u306a\u304f\u30ed\u30fc\u30ab\u30eb\u3067\u884c\u3046\u3053\u3068\u3068\u3057\u307e\u3059.<\/p>\n CI \u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066 CircleCI \u3092\u5229\u7528\u3057\u305f\u306e\u306f, GitHub \u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3067\u3082\u7121\u6599\u3067\u5229\u7528\u3067\u304d\u308b\u305f\u3081\u3067\u3059. \u307e\u305f, \u4eca\u56de\u306f Docker \u3092\u5229\u7528\u3057\u3066 TeX \u3092\u5c0e\u5165\u3059\u308b\u305f\u3081, Docker \u3092\u5229\u7528\u3067\u304d\u308b\u3053\u3068\u3082 CircleCI \u3092\u5229\u7528\u3057\u305f\u7406\u7531\u306e\u4e00\u3064\u3067\u3059.<\/p>\n CircleCI \u3067\u5229\u7528\u3055\u308c\u308b\u30c6\u30b9\u30c8\u74b0\u5883\u306f Ubuntu 12.04<\/a> \u307e\u305f\u306f Ubuntu 14.04<\/a> \u3067\u3059. Ubuntu 14.04 \u3067\u6a19\u6e96\u3067\u5c0e\u5165\u3067\u304d\u308b TeX Live \u306f 2013 \u3068\u306a\u3063\u3066\u304a\u308a<\/a>\u5c11\u3057\u53e4\u3044\u3053\u3068\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059.<\/p>\n \u4eca\u56de\u306f Docker \u3092\u7528\u3044\u3066\u3088\u308a\u65b0\u3057\u3044 Ubuntu 16.10 \u306e\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u308a TeX Live 2016 (texlive in yakkety<\/a>) \u3092\u5229\u7528\u3057\u307e\u3059. TeX Live 2013 \u3067\u5341\u5206\u306a\u5834\u5408\u306f, \u3042\u3048\u3066 Docker \u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093.<\/p>\n TeX Live 2016 \u3092\u7528\u3044\u3066\u539f\u7a3f\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u305f\u3081, Ubuntu 16.10 \u306e Docker \u30a4\u30e1\u30fc\u30b8\u3092\u30d9\u30fc\u30b9\u306b, \u65b0\u305f\u306a\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3059. \u4ee5\u4e0b\u306e \u6700\u5f8c\u306b \u76ee\u6a19<\/h2>\n
CircleCI<\/h2>\n
Docker \u30a4\u30e1\u30fc\u30b8<\/h2>\n
Dockerfile<\/code> \u3067\u306f, TeX Live \u95a2\u4fc2\u306e\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u306a\u3063\u3066\u3044\u307e\u3059. \u539f\u7a3f\u306e\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306f
\/app<\/code> \u4ee5\u4e0b\u306b\u914d\u7f6e\u3057, latexmk \u3067\u539f\u7a3f\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059. \u30b3\u30f3\u30d1\u30a4\u30eb\u65b9\u6cd5\u7b49\u306f\u9069\u5b9c\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044.<\/p>\n
FROM ubuntu:yakkety\r\n\r\nRUN apt-get update \\\r\n && apt-get install -y --no-install-recommends \\\r\n latexmk \\\r\n lmodern \\\r\n texlive \\\r\n texlive-lang-japanese \\\r\n && rm -rf \/var\/lib\/apt\/lists\/*\r\n\r\nRUN mkdir -p \/app\r\nWORKDIR \/app\r\n\r\nCMD latexmk<\/code><\/pre>\n
circle.yml<\/h2>\n
circle.yml<\/code> \u306b CircleCI \u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3057\u307e\u3059. \u307e\u305a\u306f, dependencies \u3067\u539f\u7a3f\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u305f\u3081\u306e Docker \u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059. \u6b21\u306b, test \u3067 Docker \u30a4\u30e1\u30fc\u30b8\u3092\u5b9f\u884c\u3057, \u539f\u7a3f\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059.<\/p>\n
machine:\r\n services:\r\n - docker\r\ndependencies:\r\n override:\r\n - docker info\r\n - docker build -t tex .\r\ntest:\r\n override:\r\n - docker run -v $(pwd):\/app --name tex tex latexmk\r\n post:\r\n - docker cp tex:\/app\/paper.pdf $CIRCLE_ARTIFACTS\/<\/code><\/pre>\n
$CIRCLE_ARTIFACTS<\/code> \u306b\u751f\u6210\u3055\u308c\u305f PDF \u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059. \u3053\u308c\u306b\u3088\u308a CircleCI \u306e artifacts \u304b\u3089\u751f\u6210\u3055\u308c\u305f PDF \u30d5\u30a1\u30a4\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059.<\/p>\n