Skip to content

Commit a761edb

Browse files
committed
feat: rebase with master
1 parent c4e969f commit a761edb

File tree

7 files changed

+1019
-0
lines changed

7 files changed

+1019
-0
lines changed

.github/workflows/changelog.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Generate Changelog
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
generate-changelog:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Conventional Changelog Action
22+
id: changelog
23+
uses: TriPSs/conventional-changelog-action@v5
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
git-message: 'chore(release): {version}'
27+
git-user-name: 'github-actions[bot]'
28+
git-user-email: 'github-actions[bot]@users.noreply.github.com'
29+
preset: 'angular'
30+
tag-prefix: 'v'
31+
output-file: 'CHANGELOG.md'
32+
release-count: '10'
33+
version-file: 'package.json'
34+
skip-on-empty: 'true'
35+
skip-version-file: 'false'
36+
skip-commit: 'true'
37+
skip-tag: 'true'
38+
skip-ci: 'true'
39+
create-summary: 'true'
40+
pre-release: 'true'
41+
pre-release-identifier: 'alpha'
42+
43+
- name: Create Pull Request
44+
if: steps.changelog.outputs.skipped == 'false'
45+
uses: peter-evans/create-pull-request@v5
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN }}
48+
commit-message: 'chore(release): update changelog'
49+
title: 'chore(release): update changelog'
50+
body: |
51+
This PR updates the changelog with the latest changes.
52+
53+
Generated automatically by the changelog workflow.
54+
branch: 'chore/update-changelog'
55+
delete-branch: true
56+
base: 'master'

cli/app/commands/clone/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

cli/app/commands/setup/__init__.py

Whitespace-only changes.

cli/app/commands/setup/command.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import typer
2+
from app.utils.logger import Logger
3+
from app.utils.timeout import TimeoutWrapper
4+
from .dev import DevSetup, DevSetupConfig
5+
6+
setup_app = typer.Typer(help="Setup development and production environments")
7+
8+
@setup_app.command()
9+
def dev(
10+
# Port configurations from config.dev.yaml defaults
11+
api_port: int = typer.Option(8080, "--api-port", help="API server port"),
12+
view_port: int = typer.Option(7443, "--view-port", help="Frontend server port"),
13+
db_port: int = typer.Option(5432, "--db-port", help="Database port"),
14+
redis_port: int = typer.Option(6379, "--redis-port", help="Redis port"),
15+
16+
# Repository and branch configuration
17+
branch: str = typer.Option("feat/develop", "--branch", "-b", help="Git branch to clone"),
18+
repo: str = typer.Option(None, "--repo", "-r", help="Custom repository URL"),
19+
workspace: str = typer.Option("./nixopus-dev", "--workspace", "-w", help="Target workspace directory"),
20+
21+
# SSH configuration
22+
ssh_key_path: str = typer.Option("~/.ssh/id_ed25519_nixopus", "--ssh-key-path", help="SSH key location"),
23+
ssh_key_type: str = typer.Option("ed25519", "--ssh-key-type", help="SSH key type"),
24+
25+
# Setup options
26+
skip_preflight: bool = typer.Option(False, "--skip-preflight", help="Skip preflight validation checks"),
27+
skip_conflict: bool = typer.Option(False, "--skip-conflict", help="Skip conflict detection"),
28+
skip_deps: bool = typer.Option(False, "--skip-deps", help="Skip dependency installation"),
29+
skip_docker: bool = typer.Option(False, "--skip-docker", help="Skip Docker-based database setup"),
30+
skip_ssh: bool = typer.Option(False, "--skip-ssh", help="Skip SSH key generation"),
31+
skip_admin: bool = typer.Option(False, "--skip-admin", help="Skip admin account creation"),
32+
33+
# Admin credentials
34+
admin_email: str = typer.Option(None, "--admin-email", help="Admin email (defaults to $USER@example.com)"),
35+
admin_password: str = typer.Option("Nixopus123!", "--admin-password", help="Admin password"),
36+
37+
# Control options
38+
force: bool = typer.Option(False, "--force", "-f", help="Force overwrite existing files"),
39+
dry_run: bool = typer.Option(False, "--dry-run", "-d", help="Show what would be done"),
40+
verbose: bool = typer.Option(False, "--verbose", "-v", help="Detailed output"),
41+
timeout: int = typer.Option(300, "--timeout", "-t", help="Operation timeout in seconds"),
42+
43+
# Output configuration
44+
output: str = typer.Option("text", "--output", "-o", help="Output format (text/json)"),
45+
46+
# Configuration override
47+
config_file: str = typer.Option("../helpers/config.dev.yaml", "--config-file", "-c", help="Configuration file path"),
48+
):
49+
"""Setup complete development environment for Nixopus"""
50+
try:
51+
logger = Logger(verbose=verbose)
52+
53+
# Create configuration object
54+
config = DevSetupConfig(
55+
api_port=api_port,
56+
view_port=view_port,
57+
db_port=db_port,
58+
redis_port=redis_port,
59+
branch=branch,
60+
repo=repo,
61+
workspace=workspace,
62+
ssh_key_path=ssh_key_path,
63+
ssh_key_type=ssh_key_type,
64+
skip_preflight=skip_preflight,
65+
skip_conflict=skip_conflict,
66+
skip_deps=skip_deps,
67+
skip_docker=skip_docker,
68+
skip_ssh=skip_ssh,
69+
skip_admin=skip_admin,
70+
admin_email=admin_email,
71+
admin_password=admin_password,
72+
force=force,
73+
dry_run=dry_run,
74+
verbose=verbose,
75+
timeout=timeout,
76+
output=output,
77+
config_file=config_file,
78+
)
79+
80+
# Initialize development setup orchestrator
81+
dev_setup = DevSetup(config=config, logger=logger)
82+
83+
# Execute setup with timeout
84+
with TimeoutWrapper(timeout):
85+
dev_setup.run()
86+
87+
logger.success("Development environment setup completed successfully!")
88+
89+
except TimeoutError as e:
90+
logger.error(f"Setup timed out after {timeout} seconds: {e}")
91+
raise typer.Exit(1)
92+
except Exception as e:
93+
logger.error(f"Setup failed: {e}")
94+
if verbose:
95+
import traceback
96+
logger.error(traceback.format_exc())
97+
raise typer.Exit(1)

0 commit comments

Comments
 (0)