feat(#344): Add Woodpecker CI pipeline monitoring to cli-tools
- Add ci-pipeline-status.sh for checking pipeline status - Add ci-pipeline-logs.sh for fetching logs - Add ci-pipeline-wait.sh for waiting on completion - Update package.json bin section - Update README with CI commands and examples Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
# @mosaic/cli-tools
|
||||
|
||||
CLI tools for Mosaic Stack orchestration - git operations that work with both Gitea and GitHub.
|
||||
CLI tools for Mosaic Stack orchestration - git operations and CI monitoring.
|
||||
|
||||
## Overview
|
||||
|
||||
These scripts abstract the differences between `tea` (Gitea CLI) and `gh` (GitHub CLI), providing a unified interface for:
|
||||
These scripts provide unified interfaces for:
|
||||
|
||||
- Issue management (create, list, assign, close, comment)
|
||||
- Pull request management (create, list, merge, review)
|
||||
- Milestone management (create, list, close)
|
||||
- **Git Operations**: Abstract differences between `tea` (Gitea CLI) and `gh` (GitHub CLI)
|
||||
- Issue management (create, list, assign, close, comment)
|
||||
- Pull request management (create, list, merge, review)
|
||||
- Milestone management (create, list, close)
|
||||
- **CI Monitoring**: Woodpecker CI pipeline integration
|
||||
- Pipeline status checking
|
||||
- Log retrieval
|
||||
- Automated waiting for completion
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -56,6 +61,14 @@ pnpm exec mosaic-issue-create -t "Title" -b "Body"
|
||||
| `mosaic-milestone-list` | List milestones |
|
||||
| `mosaic-milestone-close` | Close a milestone |
|
||||
|
||||
### CI/CD (Woodpecker)
|
||||
|
||||
| Command | Description |
|
||||
| --------------------------- | ------------------------------------ |
|
||||
| `mosaic-ci-pipeline-status` | Check pipeline status (latest or #N) |
|
||||
| `mosaic-ci-pipeline-logs` | Fetch pipeline logs |
|
||||
| `mosaic-ci-pipeline-wait` | Wait for pipeline completion |
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Create an issue with milestone
|
||||
@@ -90,6 +103,19 @@ mosaic-pr-create \
|
||||
mosaic-pr-merge -n 42 -m squash -d
|
||||
```
|
||||
|
||||
### Monitor CI pipeline
|
||||
|
||||
```bash
|
||||
# Check latest pipeline status
|
||||
mosaic-ci-pipeline-status --latest
|
||||
|
||||
# Wait for specific pipeline to complete
|
||||
mosaic-ci-pipeline-wait -n 42
|
||||
|
||||
# Fetch logs on failure
|
||||
mosaic-ci-pipeline-logs -n 42
|
||||
```
|
||||
|
||||
## Platform Detection
|
||||
|
||||
The scripts automatically detect whether you're working with Gitea or GitHub by examining the git remote URL. No configuration needed.
|
||||
@@ -99,10 +125,19 @@ The scripts automatically detect whether you're working with Gitea or GitHub by
|
||||
|
||||
## Requirements
|
||||
|
||||
### Git Operations
|
||||
|
||||
- **Gitea**: `tea` CLI installed and authenticated
|
||||
- **GitHub**: `gh` CLI installed and authenticated
|
||||
- **Both**: `git` available in PATH
|
||||
|
||||
### CI Monitoring (Woodpecker)
|
||||
|
||||
- `woodpecker` CLI installed ([installation guide](https://woodpecker-ci.org/docs/usage/cli))
|
||||
- Environment variables set:
|
||||
- `WOODPECKER_SERVER` - Woodpecker server URL (e.g., `https://ci.mosaicstack.dev`)
|
||||
- `WOODPECKER_TOKEN` - API token from Woodpecker UI (User → Access tokens)
|
||||
|
||||
## For Orchestrators
|
||||
|
||||
When using these tools in orchestrator/worker contexts:
|
||||
|
||||
Reference in New Issue
Block a user