Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

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

Avatar for tsuyoshi wada

tsuyoshi wada

March 09, 2018
Tweet

More Decks by tsuyoshi wada

Other Decks in Technology

Transcript

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

    CyberAgent, Inc ʹೖࣾ͠·ͨ͠ • Web ϑϩϯτΤϯδχΞʹͳΓ·ͨ͠ • ࠷ۙ Go ָ͕͍͠
  2. yarn-outdated-formatter • $ yarn outdated ͷ݁Ռʹ CHANGELOG ΁ͷϦϯΫΛ෇͚ͯ͘ΕΔ • ݁Ռ͸

    Markdown ΍ JSON Ͱड͚औΕΔ • CHANGELOG ͷࢀরͰɺมߋՕॴ͕೺ѲͰ͖Δͱ… • Assignee ͱ Reviewer ͷෛ୲͕ܰݮͰ͖ͯօϋοϐʔ • هࣄதͰ͸1ϲ݄͓͖ʹʮΞοϓσʔτσʔʯΛઃ͚͍ͯΔͱͷ͜ͱ
  3. 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. # 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. # workflows Ͱઌఔ࡞ͬͨ `job` Λݺͼग़͢ # ҎԼ͸ɺ೔ຊ࣌ؒͷຖि༵ۚ೔ޕલ10:00ʹ௨஌ॲཧΛ։࢝͢Δྫ workflows: version: 2

    notifications: jobs: - notify_outdated triggers: cron: “0 1 * * 5” filters: branches: only: - master cron Ͱ job Λݺͼग़͢
  6. CI ͱ Yarn ͚ͩͰಋೖͰ͖Δͷ͸खܰ • Greenkeeper ͳͲͷ֎෦αʔϏεΛಋೖ͢Δͱ؅ཧର৅͕૿͑ͯखؒ • CI ͸ΈΜͳ࢖ͬͯΔ͠

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