Skip to content

feat(install): devbase ワンライナー installer (curl | bash) (PLAN31_1)#47

Merged
takemi-ohama merged 6 commits into
mainfrom
feature/PLAN31_1-installer
Jun 9, 2026
Merged

feat(install): devbase ワンライナー installer (curl | bash) (PLAN31_1)#47
takemi-ohama merged 6 commits into
mainfrom
feature/PLAN31_1-installer

Conversation

@takemi-ohama

Copy link
Copy Markdown
Contributor

Summary

  • plan: issues/PLAN31_1_devbase-installer.md
  • curl -fsSL .../install.sh | bashclone(既存なら git pull --ff-only)→ bin/devbase init まで自動完了するワンライナー installer を新設
  • uv 自動導入・PATH/補完登録・plugins.yml 生成・冪等性・旧版移行はすべて既存の devbase init に委譲(installer は薄い 2 手のみ)
  • plan §6 の「PR2 を畳む」判断を採用し、installer 本体 + テスト + CI + docs を 1 PR に集約(総差分 ~約450行、関心は installer 導入に一本化)

変更点

  • install.sh(新規): set -euo pipefail / git・curl 必須チェック(docker は警告のみ)/ DEVBASE_INSTALL_DIR_REPO_REF 対応 / DEVBASE_INSTALL_REF サニタイズ(先頭-・シェルメタ文字・コマンド置換を拒否)/ 既存ディレクトリ3分岐(pull / 中止 / clone)/ cd 後に bin/devbase init 1回 / 完了案内
  • tests/cli/test_install_sh.py(新規): ローカル雛形 repo + init スタブで分岐ロジックを検証(新規clone・init1回/CWD・既定$HOME/devbase・冪等pull・非devbase中止・git不在・不正REF×4 = 10件
  • .github/workflows/ci.yml: shellcheck ジョブに install.shseverity=error)を追加
  • README.md / docs/user/getting-started.md: ワンライナー節 + env 変数表 + curl|bash 確認手順を追記
  • CHANGELOG.md: Unreleased に追記

非機能 / セキュリティ

  • 非 TTY(curl|bash)で対話プロンプトを出さない。env init は対話必須のため実行せず案内のみ
  • 配置先が devbase 以外の非空ディレクトリなら誤上書きを避けて中止
  • git clone --branch "$REF" -- "$REPO" "$DIR" で位置引数のオプション解釈を遮断 + REF charset 検証

Test plan

  • pytest tests/cli/test_install_sh.py → 10 passed
  • 全体回帰 pytest → 474 passed / 1 skipped
  • shellcheck install.sh(全 severity)指摘ゼロ / shellcheck --severity=error(CI 相当)通過
  • 結合: 実 ~/devbase へ通し init 後に source "$(bin/devbase shell-rc)"devbase --help が PATH 解決すること(ホスト Mac で確認推奨)

takemi-ohama and others added 6 commits June 9, 2026 15:16
clone (既存なら git pull --ff-only) して bin/devbase init を 1 回呼ぶ薄い
installer を新設。uv 自動導入・PATH/補完登録・plugins.yml 生成・冪等性・
旧版移行はすべて既存の init に委譲する。

- 前提チェック: git/curl 必須・docker は警告のみ
- DEVBASE_INSTALL_DIR/_REPO/_REF で配置先・clone元・ref を上書き可能
- DEVBASE_INSTALL_REF はサニタイズ (オプション注入/メタ文字を拒否)
- 既存ディレクトリが devbase 以外の非空なら誤上書きを避けて中止
- 非 TTY (curl|bash) で対話しない。env init は対話必須のため案内のみ
- tests/cli/test_install_sh.py: clone/init/冪等pull/中止/git不在/不正REF を検証
- CI に install.sh の ShellCheck (severity=error) を追加

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ワンライナー節の「env init は対話が必要なため案内のみで、自動実行はしません」
は冗長なため削除 (getting-started 側に同旨の記載あり)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`... | bash && source "$(~/devbase/bin/devbase shell-rc)"` の形にして、
インストール直後にその端末で devbase が使えるようにする。`&&` 以降は
パイプのサブシェルではなく呼び出し元の対話シェルで実行されるため、
installer 本体を変更せずワンライナーだけで現在のシェルに PATH を通せる。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
長さの主因だった URL を 2 度出さないよう、ヘッドラインは
`curl ... | bash` の素の 1 行に戻し、現在端末での即時有効化
(`&& source "$(...)"`) はインライン文章で案内する形に変更。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
plan §8 の未決事項「正規ホスティング」を確定。GitHub Pages +
カスタムドメイン dl.basex.jp で https://dl.basex.jp/install.sh を
配信する構成・DNS 仕様(お名前.com は CNAME 用 API 無し)・
Actions 配信方式・初回セットアップ手順・検証コマンド・コスト比較を
docs/developer/installer-hosting.md にまとめる。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
install.sh のみを成果物として公開する Pages デプロイワークフローを追加。
main への push (install.sh / pages.yml 変更時) で自動デプロイする。
配信仕様: docs/developer/installer-hosting.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@takemi-ohama takemi-ohama marked this pull request as ready for review June 9, 2026 16:16
@takemi-ohama takemi-ohama merged commit 74c0236 into main Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant