Allow passing URL, username, and password via global options (-u, -U, -P) as an alternative to environment variables. Options take precedence over environment variables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
87 lines
1.3 KiB
Markdown
87 lines
1.3 KiB
Markdown
# zzpyjenkins
|
|
|
|
A CLI tool to interact with Jenkins server for building jobs.
|
|
|
|
## Installation
|
|
|
|
### Using uvx (recommended)
|
|
|
|
```bash
|
|
uvx install zzpyjenkins
|
|
```
|
|
|
|
Or run directly:
|
|
|
|
```bash
|
|
uvx --from zzpyjenkins zzpyjenkins --help
|
|
```
|
|
|
|
### From source
|
|
|
|
```bash
|
|
uv sync
|
|
uv run zzpyjenkins --help
|
|
```
|
|
|
|
## Configuration
|
|
|
|
You can provide Jenkins credentials via command-line options or environment variables:
|
|
|
|
### Command-line options (preferred)
|
|
|
|
```bash
|
|
zzpyjenkins -u https://jenkins.example.com -U username -P token info
|
|
```
|
|
|
|
### Environment variables
|
|
|
|
```bash
|
|
export JENKINS_URL="https://your-jenkins-server.com"
|
|
export JENKINS_USERNAME="your_username"
|
|
export JENKINS_PASSWORD="your_api_token" # or JENKINS_TOKEN
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
# Show Jenkins server info
|
|
zzpyjenkins info
|
|
|
|
# List all jobs
|
|
zzpyjenkins list
|
|
|
|
# List jobs with filter
|
|
zzpyjenkins list -p "my-project"
|
|
|
|
# Trigger a build
|
|
zzpyjenkins build my-job-name
|
|
|
|
# Trigger a build with parameters
|
|
zzpyjenkins build my-job-name -p BRANCH=main -p ENV=staging
|
|
|
|
# Get build status
|
|
zzpyjenkins status my-job-name
|
|
|
|
# Get specific build status
|
|
zzpyjenkins status my-job-name 123
|
|
|
|
# Watch build progress
|
|
zzpyjenkins watch my-job-name
|
|
```
|
|
|
|
## Development
|
|
|
|
```bash
|
|
# Install dev dependencies
|
|
uv sync
|
|
|
|
# Run tests
|
|
uv run pytest
|
|
|
|
# Format code
|
|
uv run ruff format .
|
|
|
|
# Lint
|
|
uv run ruff check .
|
|
```
|