CircleCIでyarn upgradeとかbundle updateをやってプルリクを作ってもらう
ほんとにライフチェンジングなのでやってない人はぜひやってみてほしい。
CIでまいにちbundleとかyarnのアップデートやらせるやつまじで革命的な生活だからもっとはやくやればよかったと思ってる
— dtsuji (@dim0627) July 1, 2018
有志が以下のような素晴らしいツールを公開してくれているので、これらをありがたく使わせてもらう!
- masutaka/circleci-bundle-update-pr: Create PullRequest of bundle update in CircleCI
- taichi/ci-yarn-upgrade: Keep NPM dependencies up-to-date with CI, providing version-to-version diff for each library
CircleCIで依存ライブラリのアップデートを回す
僕はこんなconfig.yml
を使っている。
version: 2 jobs: build: # your default build scripts. bundle-update: docker: - image: circleci/ruby:2.5.1-node steps: - checkout - restore_cache: name: Restore bundler cache key: rails-demo-{{ checksum "Gemfile.lock" }} - run: name: Setup requirements for continuous bundle update command: gem install -N circleci-bundle-update-pr - deploy: name: Continuous bundle update command: circleci-bundle-update-pr $GIT_USER_NAME $GIT_USER_EMAIL yarn-upgrade: docker: - image: node:6-alpine steps: - run: apk add --update --no-cache git openssh-client - checkout - run: yarn global add ci-yarn-upgrade - run: yarn install - run: ci-yarn-upgrade --execute --verbose --latest; workflows: version: 2 build_and_test: jobs: - build nightly-bundle-update: triggers: - schedule: cron: "0 0 * * *" filters: branches: only: master jobs: - bundle-update nightly-yarn-upgrade: triggers: - schedule: cron: "0 0 * * *" filters: branches: only: master jobs: - yarn-upgrade
CircleCI上のcronはUTCで回るので、日本だとAM9時に処理がされる。
サービスにやらせるならこれ
たぶん王道はこの辺なのかなー。
- Dependabot - Automated Dependency Updates
- renovatebot/renovate: Automated dependency updates. Flexible, so you don't need to be.
- Greenkeeper | Automate your npm dependency management
どちらもセルフホスティングできるはずなので、お金払いたくないなら自分でたてちゃえば済むと思う。