Yarn + CI + GitHub で挑む npm パッケージの定期更新

Yarn + CI + GitHub で挑む npm パッケージの定期更新

Greenkeeper を使わない npm パッケージの更新戦略について提案です

Dc696687bae442425a220771df158346?s=128

tsuyoshi wada

March 09, 2018
Tweet

Transcript

  1. 2.

    ࣗݾ঺հ @wadackel / ΘͩͭΑ͠ tsuyoshiwada https://blog.wadackel.me • ΠϯλʔωοτͰ྘ͷŘŕŭ΍͍ͬͯ·͢ • ࠓ೥1݄ʹ

    CyberAgent, Inc ʹೖࣾ͠·ͨ͠ • Web ϑϩϯτΤϯδχΞʹͳΓ·ͨ͠ • ࠷ۙ Go ָ͕͍͠
  2. 11.

    yarn-outdated-formatter • $ yarn outdated ͷ݁Ռʹ CHANGELOG ΁ͷϦϯΫΛ෇͚ͯ͘ΕΔ • ݁Ռ͸

    Markdown ΍ JSON Ͱड͚औΕΔ • CHANGELOG ͷࢀরͰɺมߋՕॴ͕೺ѲͰ͖Δͱ… • Assignee ͱ Reviewer ͷෛ୲͕ܰݮͰ͖ͯօϋοϐʔ • هࣄதͰ͸1ϲ݄͓͖ʹʮΞοϓσʔτσʔʯΛઃ͚͍ͯΔͱͷ͜ͱ
  3. 15.

    yarn-outdated-notifier yarn-outdated-formatter ͷ݁ՌΛ GitHub ͷ Personal access tokens Λ ࢖ͬͯ

    Issue ΁௨஌ͯ͘͠ΕΔ $ yarn outdated-notifier \ --api-token <your_token> \ --labels <label_name> \ --assignees <assignee_name> \ --changelogs ./changelogs.yml
  4. 19.

    # GITHUB_API_TOKEN ͸ Environment Variables ʹ௥Ճ͓ͯ͘͠ job: notify_outdated: docker: -

    image: circleci/node:9.3 working_directory: ~/repo steps: - checkout - yarn - run: yarn outdated-notifier --api-token $GITHUB_API_TOKEN ௨஌༻ͷ job Λ࡞Δ
  5. 20.

    # workflows Ͱઌఔ࡞ͬͨ `job` Λݺͼग़͢ # ҎԼ͸ɺ೔ຊ࣌ؒͷຖि༵ۚ೔ޕલ10:00ʹ௨஌ॲཧΛ։࢝͢Δྫ workflows: version: 2

    notifications: jobs: - notify_outdated triggers: cron: “0 1 * * 5” filters: branches: only: - master cron Ͱ job Λݺͼग़͢
  6. 25.

    CI ͱ Yarn ͚ͩͰಋೖͰ͖Δͷ͸खܰ • Greenkeeper ͳͲͷ֎෦αʔϏεΛಋೖ͢Δͱ؅ཧର৅͕૿͑ͯखؒ • CI ͸ΈΜͳ࢖ͬͯΔ͠

    (࢖ͬͯΔΑͶ??) ɺಋೖোน͕௿͍ • CircleCI Λྫʹग़͚ͨ͠Ͳɺେ൒ͷ CI ͸ cron ࣋ͬͯΔ
  7. 27.