Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
社内パッケージの再利用にSatisを使っている話.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kin29
April 11, 2022
Programming
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
社内パッケージの再利用にSatisを使っている話.pdf
PHPerKaigi2022
kin29
April 11, 2022
More Decks by kin29
See All by kin29
外部APIとズブズブな開発どうしてますか?
kin29
2
2.2k
【Symfony超入門】コマンドだけでCRUD画面を作るチート法
kin29
0
890
めんそ〜れ!モブプロ!!!
kin29
0
840
Other Decks in Programming
See All in Programming
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
110
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
270
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
5.9k
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
190
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
280
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
890
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
950
Faster Mobile Websites
deanohume
310
31k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
720
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
BBQ
matthewcrist
89
10k
We Are The Robots
honzajavorek
0
250
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
ラッコキーワード サービス紹介資料
rakko
1
3.7M
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Transcript
社内パッケージの再利用に satisを使っている話 志賀 彩乃
自己紹介 • 林(旧:志賀) 彩乃 • PHPer 6年 • Symfony 3年
• カルテットコミュニケーションズ 3年(産休育休1年含む) • 子育て中(1歳半息子) Twitter: @kin29ma_n / GitHub: @kin29
本題に入ります
PHPerのみなさんに質問です プライベートな社内パッケージを再利用したい時、 どうやってますか?
プライベートな社内パッケージの例 プライベートな社内パッケージ (秘伝のタレ) サービスA (秘伝のタレを使ったうなぎ ) サービスB (秘伝のタレを使った焼き鳥 )
(packagistに未登録) quartetcom/repository composer requireできない packagistに登録していないリポジトリは再利用することはできない packagist symfony/symfony … $ composer
require symfony/symfony $ composer require quartetcom/repository
しかし
quartetcom/repository を使いたい人 composer requireできる + "repositories": { + "quartetcom/repository": {
+ "type": "vcs", + "url": "https://github.com/quartetcom/repository.git" + } + } composer.json composer.jsonのrepositoriesに追加すればcomposer requireできる! $ composer require quartetcom/repository quartetcom/repository (packagistに未登録)
ただし、以下のデメリットがある🥺 • 再利用したいリポジトリが複数ある場合、 そのリポジトリの数だけcomposer.jsonに追記する必要がある。
quartetcom/repo1~3 を使いたい人 "repositories": { "quartetcom/repo1": { "type": "vcs", "url": "https://github.com/quartetcom/repo1.git"
} } composer.json quartetcom/repo1 (packagistに未登録) $ composer require
quartetcom/repo1~3 を使いたい人 "repositories": { "quartetcom/repo1": { "type": "vcs", "url": "https://github.com/quartetcom/repo1.git"
}, + "quartetcom/repo2": { + "type": "vcs", + "url": "https://github.com/quartetcom/repo2.git" + }, } composer.json quartetcom/repo1 (packagistに未登録) quartetcom/repo2 $ composer require $ composer require
quartetcom/repo1~3 を使いたい人 "repositories": { "quartetcom/repo1": { "type": "vcs", "url": "https://github.com/quartetcom/repo1.git"
}, + "quartetcom/repo2": { + "type": "vcs", + "url": "https://github.com/quartetcom/repo2.git" + }, + "quartetcom/repo3": { + "type": "vcs", + "url": "https://github.com/quartetcom/repo3.git" + } } composer.json quartetcom/repo1 (packagistに未登録) quartetcom/repo2 quartetcom/repo3 $ composer require
quartetcom/repo1~3 を使いたい人 quartetcom/repo1 (packagistに未登録) quartetcom/repo2 quartetcom/repo3 $ composer require "repositories":
{ "quartetcom/repo1": { "type": "vcs", "url": "https://github.com/quartetcom/repo1.git" }, + "quartetcom/repo2": { + "type": "vcs", + "url": "https://github.com/quartetcom/repo2.git" + }, + "quartetcom/repo3": { + "type": "vcs", + "url": "https://github.com/quartetcom/repo3.git" + } } composer.json めんどう😓
その問題、Satisで解決できるかも
{ "name": "quartetcom.composer", "homepage": "https://quartetcom/composer", "repositories": [ { "type": "vcs",
"url": "https://github.com/quartetcom/repo1" }, { "type": "vcs", "url": "https://github.com/quartetcom/repo2" }, { "type": "vcs", "url": "https://github.com/quartetcom/repo3" } ], "require-all": true } satis.json quartetcom/repo1~3 を使いたい人 再利用したいリポジトリ quartetcom/repo1 quartetcom/repo2 quartetcom/repo3 $ composer require + "repositories": { + "quartetcom": { + "type": "composer", + "url": "https://quartetcom/composer" + } + }, composer.json $ vendor/bin/satis build satis.json web/ Scanning packages Wrote packages to docs/p2/quartetcom/repo1.json Wrote packages to docs/p2/quartetcom/repo1~dev.json … Writing packages.json Pruning include directories Writing web view
メリット💡 • satis.jsonに再利用対象のリポジトリを追加→buildするだけでok • 複数パッケージを一括管理しやすい • 一覧画面もいい感じにできる👉 • Basic認証で制限も可能 •
ビルドインwebサーバで無料で簡単にできる $ php -S localhost:8888 -t web • GitHub Pagesでも作れました🎉 https://kin29.github.io/composer-repository/
kin29/repo1 - v0.0.1 - v0.0.2🆕 POST (おまけ)GitHub Actionsでsatis buildを自動化してみた! on:
release: types: [published] jobs: run: | curl --request POST 'https://api.github.com/repos/kin29/coposer-repository/dispatches' \ --header 'Authorization: Bearer ${{secrets.MY_TOKEN}}' \ --header 'Content-Type: application/json' \ --data-raw '{"event_type": "repository-updated"}' kin29/composer-repository on: repository_dispatch: types: [repository-updated] jobs: - name: satis build run: | composer config --global github-oauth.github.com ${{secrets.MY_TOKEN}} vendor/bin/satis build satis.json docs - name: Push build files run: | git remote set-url origin https://github-actions:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPO} git config --global user.name "${GITHUB_ACTOR}" git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" if (git diff --shortstat | grep '[0-9]'); then \ git add .; \ git commit -m "👕 Fixed satis build files by github-actions"; \ git push origin HEAD:${GITHUB_REF}; \ fi
private packagistというサービスもあります • https://packagist.com/ • 無料トライアルあり(その後は課金制)
ところで
実はComposer、 Symfonyコミュニティから生まれました!
カルテットはSymfonyで開発をしています! エンジニア・デザイナー大募集中です。 私のようにフルリモートで働くことができたり、 子育て中でも働きやすい環境です^^ ご興味がある方はこちらからどうぞ👇 https://quartetcom.co.jp/recruit/engineer/
ご清聴ありがとうございました 参考: https://getcomposer.org/doc/articles/handling-private-packages.md https://github.com/composer/satis