Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,13 +2,18 @@

[devbase](https://github.com/devbasex/devbase) のサンプルプラグインレジストリです。初めてdevbaseを使うユーザーがすぐに試せるよう、汎用的な公開ツールを収録しています。

> **必要な devbase バージョン**: 3.0.0 以上。各プロジェクトの設定は `project.yml` 形式で書かれており、2.x では読み込めません。

## 収録プラグイン

| プラグイン | 説明 | コンテナ | GIT_USER/GIT_REPO |
|-----------|------|---------|-------------------|
| プラグイン | 説明 | コンテナ | リポジトリ (`repos[].owner/repo`) |
|-----------|------|---------|-----------------------------------|
| `adminer` | 軽量DB管理ツール | `php` | `vrana/adminer` |
| `ai-plugins` | Claude Codeプラグインマーケットプレイス開発環境 | `general` | `devbasex/ai-plugins` |
| `devbase` | devbase本体の開発環境 | `general` | `devbasex/devbase` |
| `github_work_time` | GitHubアクティビティから稼働時間を集計するツール | `general` | `takemi-ohama/github_work_time` |
| `md-specgen` | Markdown仕様書自動生成ツール | `general` | `takemi-ohama/md-specgen` |
| `tmllib` | 共通ライブラリ開発環境 | `general` | `takemi-ohama/tmllib` |

## 使い方

Expand DownExpand Up@@ -47,6 +52,44 @@ cd ~/devbase/projects/adminer
devbase up
```

## プロジェクト設定 (`project.yml`)

devbase 3.0.0 から、プロジェクトの設定は `projects/<プロジェクト名>/project.yml` に書きます。1 プロジェクト = 1 コンテナ = **複数リポジトリ** という構成です。

収録プラグイン `adminer` の `projects/adminer/project.yml`:

```yaml
version: 1
scale: 1
open_editor: true
repos:
- owner: vrana
repo: adminer
```

`repos` に要素を足すだけで、1 つのプロジェクト(=1 コンテナ)に複数のリポジトリを並べられます。

```yaml
version: 1
defaults:
owner: devbasex
repos:
- repo: my-app # 先頭が primary(ログイン直後の作業ディレクトリ)
- repo: my-app-docs
```

| 設定 | 意味 |
|------|------|
| `repos[].owner` / `repos[].repo` | クローンする GitHub リポジトリ。先頭の要素が primary |
| `defaults` | `repos[]` の各要素へ継承させる既定値(`host` / `owner` / `branch` / `init`) |
| `work_dir` | コンテナ内の作業ディレクトリ(既定値と同じなら省略可) |
| `scale` | 起動するコンテナ数 |
| `open_editor` | `devbase up` 後にエディタを開くか |

スキーマの詳細は [project.yml リファレンス](https://github.com/devbasex/devbase/blob/main/docs/user/project-yml.md) を参照してください。

同じディレクトリの `env` は「**コンテナへ渡す環境変数**」だけを持ちます。`GIT_USER` / `GIT_REPO` / `CONTAINER_SCALE` / `DEVBASE_OPEN_EDITOR` といった devbase 自身の設定は `project.yml` へ移動しました。

## リポジトリ構成

```
Expand All@@ -57,7 +100,8 @@ devbase-samples/
│ └── projects/
│ └── adminer/
│ ├── compose.yml
│ └── env
│ ├── project.yml # プロジェクト設定(リポジトリ・scale・エディタ)
│ └── env # コンテナへ渡す環境変数
├── ai-plugins/
│ └── ...
└── devbase/
Expand Down
2 changes: 1 addition & 1 deletion adminer/plugin.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ name: adminer
version: "1.0.0"
description: "Adminer - 軽量DB管理ツール(PHPコンテナで動作)"
requires:
devbase: ">=2.2.0"
devbase: ">=3.0.0"
priority: 0
8 changes: 2 additions & 6 deletions adminer/projects/adminer/env
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
GIT_USER=vrana
GIT_REPO=adminer
WORK_DIR=/work/$GIT_REPO
CONTAINER_SCALE=1
# up 完了後に dev コンテナへ接続した VS Code を自動で開く (PLAN31_3)
DEVBASE_OPEN_EDITOR=1
# コンテナへ渡す環境変数を書く。
# devbase 自身の設定 (リポジトリ・scale・エディタ) は project.yml にある。
8 changes: 8 additions & 0 deletions adminer/projects/adminer/project.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
# devbase プロジェクト設定 (PLAN32)
# リポジトリを増やすときは repos に要素を足す。
version: 1
scale: 1
open_editor: true
repos:
- owner: vrana
repo: adminer
2 changes: 1 addition & 1 deletion ai-plugins/plugin.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ name: ai-plugins
version: "1.0.0"
description: "devbasex/ai-plugins - Claude Codeプラグインマーケットプレイスの開発環境"
requires:
devbase: ">=2.2.0"
devbase: ">=3.0.0"
priority: 0
8 changes: 2 additions & 6 deletions ai-plugins/projects/ai-plugins/env
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
GIT_USER=devbasex
GIT_REPO=ai-plugins
WORK_DIR=/work/$GIT_REPO
CONTAINER_SCALE=1
# up/list 完了後に dev コンテナへ接続した VS Code を自動で開く (PLAN31_3)
DEVBASE_OPEN_EDITOR=1
# コンテナへ渡す環境変数を書く。
# devbase 自身の設定 (リポジトリ・scale・エディタ) は project.yml にある。
8 changes: 8 additions & 0 deletions ai-plugins/projects/ai-plugins/project.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
# devbase プロジェクト設定 (PLAN32)
# リポジトリを増やすときは repos に要素を足す。
version: 1
scale: 1
open_editor: true
repos:
- owner: devbasex
repo: ai-plugins
2 changes: 1 addition & 1 deletion devbase/plugin.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ name: devbase
version: "1.0.0"
description: "devbase本体の開発環境(generalコンテナ)"
requires:
devbase: ">=2.2.0"
devbase: ">=3.0.0"
priority: 0
8 changes: 2 additions & 6 deletions devbase/projects/devbase/env
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
GIT_USER=devbasex
GIT_REPO=devbase
WORK_DIR=/work/$GIT_REPO
CONTAINER_SCALE=1
# up/list 完了後に dev コンテナへ接続した VS Code を自動で開く (PLAN31_3)
DEVBASE_OPEN_EDITOR=1
# コンテナへ渡す環境変数を書く。
# devbase 自身の設定 (リポジトリ・scale・エディタ) は project.yml にある。
8 changes: 8 additions & 0 deletions devbase/projects/devbase/project.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
# devbase プロジェクト設定 (PLAN32)
# リポジトリを増やすときは repos に要素を足す。
version: 1
scale: 1
open_editor: true
repos:
- owner: devbasex
repo: devbase
2 changes: 1 addition & 1 deletion github_work_time/plugin.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ name: github_work_time
version: "1.0.0"
description: "github_work_time - GitHubアクティビティから稼働時間を集計するツールの開発環境"
requires:
devbase: ">=2.2.0"
devbase: ">=3.0.0"
priority: 0
8 changes: 2 additions & 6 deletions github_work_time/projects/github_work_time/env
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
GIT_USER=takemi-ohama
GIT_REPO=github_work_time
WORK_DIR=/work/$GIT_REPO
CONTAINER_SCALE=1
# up/list 完了後に dev コンテナへ接続した VS Code を自動で開く (PLAN31_3)
DEVBASE_OPEN_EDITOR=1
# コンテナへ渡す環境変数を書く。
# devbase 自身の設定 (リポジトリ・scale・エディタ) は project.yml にある。
8 changes: 8 additions & 0 deletions github_work_time/projects/github_work_time/project.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
# devbase プロジェクト設定 (PLAN32)
# リポジトリを増やすときは repos に要素を足す。
version: 1
scale: 1
open_editor: true
repos:
- owner: takemi-ohama
repo: github_work_time
2 changes: 1 addition & 1 deletion md-specgen/plugin.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ name: md-specgen
version: "1.0.0"
description: "md-specgen - Markdown仕様書自動生成ツールの開発環境"
requires:
devbase: ">=2.2.0"
devbase: ">=3.0.0"
priority: 0
8 changes: 2 additions & 6 deletions md-specgen/projects/md-specgen/env
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
GIT_USER=takemi-ohama
GIT_REPO=md-specgen
WORK_DIR=/work/$GIT_REPO
CONTAINER_SCALE=1
# up/list 完了後に dev コンテナへ接続した VS Code を自動で開く (PLAN31_3)
DEVBASE_OPEN_EDITOR=1
# コンテナへ渡す環境変数を書く。
# devbase 自身の設定 (リポジトリ・scale・エディタ) は project.yml にある。
8 changes: 8 additions & 0 deletions md-specgen/projects/md-specgen/project.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
# devbase プロジェクト設定 (PLAN32)
# リポジトリを増やすときは repos に要素を足す。
version: 1
scale: 1
open_editor: true
repos:
- owner: takemi-ohama
repo: md-specgen
2 changes: 1 addition & 1 deletion tmllib/plugin.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ name: tmllib
version: "1.0.0"
description: "tmllib - 共通ライブラリ開発環境"
requires:
devbase: ">=2.2.0"
devbase: ">=3.0.0"
priority: 0
8 changes: 2 additions & 6 deletions tmllib/projects/tmllib/env
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
GIT_USER=takemi-ohama
GIT_REPO=tmllib
WORK_DIR=/work/$GIT_REPO
CONTAINER_SCALE=2
# up/list 完了後に dev コンテナへ接続した VS Code を自動で開く (PLAN31_3)
DEVBASE_OPEN_EDITOR=1
# コンテナへ渡す環境変数を書く。
# devbase 自身の設定 (リポジトリ・scale・エディタ) は project.yml にある。
8 changes: 8 additions & 0 deletions tmllib/projects/tmllib/project.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
# devbase プロジェクト設定 (PLAN32)
# リポジトリを増やすときは repos に要素を足す。
version: 1
scale: 2
open_editor: true
repos:
- owner: takemi-ohama
repo: tmllib