Skip to content

Commit 7898b50

Browse files
howethomasclaude
andcommitted
Initial commit: conserver-cli v0.1.0
CLI tool to manage vcon-server Docker containers with support for: - Container management (start, stop, restart, status, upgrade) - Configuration management (show, edit, set, validate, init) - Health checks and monitoring - Logs viewing with filtering Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit 7898b50

40 files changed

+7200
-0
lines changed

.github/workflows/publish.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
18+
- name: Install Poetry
19+
uses: snok/install-poetry@v1
20+
with:
21+
version: 1.8.2
22+
23+
- name: Update version from tag
24+
run: |
25+
# Extract version from tag (e.g., v0.1.0 -> 0.1.0)
26+
VERSION=${GITHUB_REF_NAME#v}
27+
poetry version $VERSION
28+
29+
- name: Build package
30+
run: poetry build
31+
32+
- name: Upload artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: dist
36+
path: dist/
37+
38+
publish-pypi:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/project/conserver-cli/
44+
permissions:
45+
id-token: write # Required for trusted publishing
46+
47+
steps:
48+
- name: Download artifacts
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: dist
52+
path: dist/
53+
54+
- name: Publish to PyPI
55+
uses: pypa/gh-action-pypi-publish@release/v1
56+
# Uses trusted publishing - no API token needed
57+
# Configure at: https://pypi.org/manage/project/conserver-cli/settings/publishing/
58+
59+
publish-test-pypi:
60+
needs: build
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: test-pypi
64+
url: https://test.pypi.org/project/conserver-cli/
65+
permissions:
66+
id-token: write
67+
68+
steps:
69+
- name: Download artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: dist
73+
path: dist/
74+
75+
- name: Publish to Test PyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
repository-url: https://test.pypi.org/legacy/
79+
continue-on-error: true # Don't fail if already published
80+
81+
update-homebrew:
82+
needs: publish-pypi
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Trigger Homebrew tap update
86+
uses: peter-evans/repository-dispatch@v3
87+
with:
88+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
89+
repository: vcon-dev/homebrew-tap
90+
event-type: update-formula
91+
client-payload: '{"version": "${{ github.ref_name }}"}'
92+
continue-on-error: true # Don't fail if tap doesn't exist yet

.github/workflows/test.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install Poetry
26+
uses: snok/install-poetry@v1
27+
with:
28+
version: 1.8.2
29+
virtualenvs-create: true
30+
virtualenvs-in-project: true
31+
32+
- name: Load cached venv
33+
id: cached-poetry-dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: .venv
37+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
38+
39+
- name: Install dependencies
40+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
41+
run: poetry install --no-interaction --no-root
42+
43+
- name: Install project
44+
run: poetry install --no-interaction
45+
46+
- name: Run tests with coverage
47+
run: |
48+
poetry run pytest --cov=conserver --cov-report=xml --cov-report=term-missing
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v4
52+
with:
53+
file: ./coverage.xml
54+
fail_ci_if_error: false
55+
56+
lint:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: "3.12"
65+
66+
- name: Install Poetry
67+
uses: snok/install-poetry@v1
68+
with:
69+
version: 1.8.2
70+
71+
- name: Install dependencies
72+
run: poetry install --no-interaction
73+
74+
- name: Run ruff check
75+
run: poetry run ruff check .
76+
77+
- name: Run ruff format check
78+
run: poetry run ruff format --check .
79+
80+
type-check:
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Set up Python
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: "3.12"
89+
90+
- name: Install Poetry
91+
uses: snok/install-poetry@v1
92+
with:
93+
version: 1.8.2
94+
95+
- name: Install dependencies
96+
run: poetry install --no-interaction
97+
98+
- name: Run mypy
99+
run: poetry run mypy conserver --ignore-missing-imports

.gitignore

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
db.sqlite3
59+
db.sqlite3-journal
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
.pybuilder/
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# pipenv
86+
Pipfile.lock
87+
88+
# poetry
89+
poetry.lock
90+
91+
# PEP 582
92+
__pypackages__/
93+
94+
# Celery stuff
95+
celerybeat-schedule
96+
celerybeat.pid
97+
98+
# SageMath parsed files
99+
*.sage.py
100+
101+
# Environments
102+
.env
103+
.venv
104+
env/
105+
venv/
106+
ENV/
107+
env.bak/
108+
venv.bak/
109+
110+
# Spyder project settings
111+
.spyderproject
112+
.spyproject
113+
114+
# Rope project settings
115+
.ropeproject
116+
117+
# mkdocs documentation
118+
/site
119+
120+
# mypy
121+
.mypy_cache/
122+
.dmypy.json
123+
dmypy.json
124+
125+
# Pyre type checker
126+
.pyre/
127+
128+
# pytype static type analyzer
129+
.pytype/
130+
131+
# Cython debug symbols
132+
cython_debug/
133+
134+
# IDE
135+
.idea/
136+
.vscode/
137+
*.swp
138+
*.swo
139+
*~
140+
141+
# OS
142+
.DS_Store
143+
Thumbs.db
144+
145+
# Project specific
146+
.conserver/
147+
*.local

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2025-01-23
11+
12+
### Added
13+
14+
- Initial release of conserver-cli
15+
- Core commands: `start`, `stop`, `status`, `restart`, `upgrade`, `logs`
16+
- Configuration commands: `config show`, `config edit`, `config set`, `config validate`, `config init`
17+
- Health monitoring: `health` command with API and Redis checks
18+
- Rich terminal output with tables and colored status indicators
19+
- Docker Compose integration for container management
20+
- Support for multiple configuration files (.env, config.yml, docker-compose.yml)
21+
- PyPI distribution support
22+
- Homebrew tap formula
23+
- Comprehensive test suite with 80%+ coverage
24+
- Full documentation
25+
26+
[Unreleased]: https://github.com/vcon-dev/vcon-server-cli/compare/v0.1.0...HEAD
27+
[0.1.0]: https://github.com/vcon-dev/vcon-server-cli/releases/tag/v0.1.0

0 commit comments

Comments
 (0)