{"id":1671,"date":"2021-07-14T15:07:32","date_gmt":"2021-07-14T06:07:32","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/?p=1671"},"modified":"2021-07-14T15:07:32","modified_gmt":"2021-07-14T06:07:32","slug":"improve-circleci","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2021\/07\/14\/improve-circleci\/","title":{"rendered":"CircleCI \u306e\u30c7\u30d7\u30ed\u30a4\u30d5\u30ed\u30fc\u3092\u6539\u5584\u3057\u305f\u3068\u304d\u306b\u3084\u3063\u305f\u3053\u3068"},"content":{"rendered":"
\u4eca\u56de\u306f\u3001\u5185\u5c71\u304c\u62c5\u5f53\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5b9f\u65bd\u3057\u305f CircleCI \u306e\u30c7\u30d7\u30ed\u30a4\u30d5\u30ed\u30fc\u306e\u6539\u5584\u7b56\u306b\u3064\u3044\u3066\u3001\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n
\u6539\u5584\u524d\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u554f\u984c\u70b9\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n
\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6539\u5584\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n
\u3053\u306e\u7d50\u679c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6539\u5584\u304c\u898b\u3089\u308c\u307e\u3057\u305f\u3002<\/p>\n
\u305d\u308c\u305e\u308c\u306e\u6539\u5584\u7b56\u306b\u3064\u3044\u3066\u3001\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n
\u3053\u308c\u307e\u3067\u3001CircleCI\u4e0a\u3067 Docker Compose \u3092\u4f7f\u3044\u3001\u30c6\u30b9\u30c8\u3084\u30c7\u30d7\u30ed\u30a4\u3092\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u3002 <\/p>\n \u3053\u306e\u70b9\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306b\u3001\u8131Docker Compose\u3059\u308b\u3053\u3068\u3092\u6c7a\u3081\u307e\u3057\u305f\u3002<\/p>\n Docker Compose\u3067\u884c\u3063\u3066\u3044\u305f\u3053\u3068\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30f3\u30c6\u30ca\u3092\u7528\u610f\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n \u3053\u308c\u306fCircleCI\u306e\u6a5f\u80fd\u3067\u4ee3\u66ff\u3067\u304d\u308b\u3053\u3068\u3067\u3059\u3002 \u3053\u306e\u5bfe\u5fdc\u306b\u3088\u308a\u3001 \u307e\u305f\u3001\u526f\u6b21\u7684\u306bGo\u8a00\u8a9e\u306e\u30c6\u30b9\u30c8\u5b9f\u884c\u51e6\u7406\u6642\u9593\u304c\u77ed\u304f\u306a\u308a\u307e\u3057\u305f\u3002 orb\u3068\u306f\u3001CircleCI\u306e\u6a5f\u80fd\u3067\u3001\u518d\u5229\u7528\u53ef\u80fd\u306aYAML\u8a2d\u5b9a\u3067\u3059\u3002
\n\u3053\u306e\u5229\u70b9\u3068\u3057\u3066\u306f\u3001\u624b\u5143\u306ePC\u3067\u5b9f\u884c\u3057\u3066\u3044\u308b\u30d5\u30ed\u30fc\u3092\u5171\u901a\u5316\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u305f\u3002
\n\u3057\u304b\u3057\u3001CircleCI\u306e\u5b9f\u884c\u7d50\u679c\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001docker-compose build<\/code> \u30b3\u30de\u30f3\u30c9\u306e\u51e6\u7406\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u5224\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n
\n
\n\u5177\u4f53\u7684\u306b\u306f\u3001 .circleci\/config.yml<\/code> \u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n
jobs:\n build:\n docker:\n - image: cimg\/go:1.16\n - image: circleci\/mysql:5.7\n environment:\n MYSQL_DATABASE: golang_db\n MYSQL_ROOT_PASSWORD: golang\n MYSQL_ROOT_HOST: '%'<\/code><\/pre>\n
docker<\/code> \u306e\u9805\u76ee\u306b\u3001\u5fc5\u8981\u306aDocker\u30a4\u30e1\u30fc\u30b8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002
\n\u3053\u306e\u4f8b\u3067\u306f\u3001\u300ccimg\/go:1.16\u300d\u3068\u300ccircleci\/mysql:5.7\u300d\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002
\n\u3053\u306e\u9805\u76ee\u3067\u3001\u5fc5\u8981\u306a\u30b3\u30f3\u30c6\u30ca\u304c\u4f5c\u6210\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\ndocker-compose build<\/code>\u306e\u51e6\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u306a\u304f\u306a\u3063\u305f\u5206\u3001\u30d3\u30eb\u30c9\u6642\u9593\u3092\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n
\n\u3053\u306e\u73fe\u8c61\u306b\u95a2\u3057\u3066\u306f\u3001\u8abf\u67fb\u306f\u307e\u3060\u884c\u3048\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u660e\u78ba\u306a\u8981\u56e0\u306f\u4e0d\u660e\u306a\u307e\u307e\u3067\u3059\u3002
\nDocker Compose\u3067\u7acb\u3061\u4e0a\u3052\u305f\u30b3\u30f3\u30c6\u30ca\u4e0a\u3067\u30c6\u30b9\u30c8\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3001\u304b\u306a\u308a\u30b3\u30b9\u30c8\u304c\u639b\u304b\u3063\u3066\u3044\u305f\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\norb \u3092\u6d3b\u7528<\/h2>\n
\n\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u304a\u3051\u308b \u30e9\u30a4\u30d6\u30e9\u30ea<\/code> \u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u306d\u3002<\/p>\n