A command line application to register, create, and deploy a new website.
- Python 3.9 or higher
- AWS CLI v2+ (for domain operations)
AWS CLI Installation:
Ubuntu/Debian:
# Method 1: Official installer (recommended)
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/installOther platforms: See AWS CLI Installation Guide
Configure AWS Credentials:
aws configure# Install Poetry if you haven't already
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install# Display help and commands
poetry run kreatisite help
# Check domain availability
poetry run kreatisite check-domain example.com
# Register a domain (privacy protection is enabled by default)
# YAML contact info must be provided for admin, registrant, and tech contacts (remove '.example' from filename `aws-register-domain.yaml.example` and update with your values).
poetry run kreatisite register-domain example.com# Activate the virtual environment
poetry shell
# Now you can run the application directly
kreatisite help
# Set up pre-commit hooks (do this once)
poetry run setup-hooks
# Run linting
poetry run lint
# Run tests
poetry run test
# Run all checks (linting + tests)
poetry run checkRun the full test suite:
# Run all tests
poetry run pytest
# Run tests with verbose output
poetry run pytest -v
# Run specific test file
poetry run pytest tests/test_cli.py
# Run tests with coverage
poetry run pytest --cov=kreatisite
# Run tests by category
poetry run pytest -m unit # Unit tests only (fast, mocked)
poetry run pytest -m integration # Integration tests only (installed package)
poetry run pytest -m e2e # End-to-end tests only (real AWS calls)
# Exclude specific test categories
poetry run pytest -m "not e2e" # All tests except E2E testsThe project includes comprehensive E2E smoke tests with proper assertions and error handling:
# Run smoke tests (requires AWS credentials for full testing)
poetry run smoke-tests
# Alternative: Run smoke tests directly with pytest
poetry run pytest -m e2e tests/test_e2e_smoke.py -v
# Run smoke tests with timeout protection
poetry run pytest -m e2e --timeout=60 tests/test_e2e_smoke.pyAWS Credentials for Smoke Tests:
The smoke tests can run in two modes:
-
With AWS credentials: Full test suite including real AWS API calls
- Set
AWS_PROFILEenvironment variable, OR - Set
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment variables
- Set
-
Without AWS credentials: Limited test suite (AWS-dependent tests are skipped)
- Tests basic CLI functionality, help commands, and error handling
- Useful for CI/CD environments without AWS access
What the smoke tests cover:
- CLI help and argument parsing
- Domain availability checking (with real AWS API calls)
- Domain registration validation and error handling
- Configuration file processing
- Error scenarios and edge cases
- Timeout and network failure handling
The project includes a pre-build script that runs all checks before building:
./prebuild.shThis will:
- Run pre-commit hooks on all files
- Run comprehensive test suite (unit + integration + E2E smoke tests)
- Build the package if all checks pass
This project uses pre-commit to enforce code quality. The following hooks are configured:
- Trailing whitespace trimming
- End of file fixing
- YAML and TOML syntax checking
- Large file detection
- Flake8 (with docstring checking)
- isort (import sorting)
- mypy (type checking)
- pytest (automated tests)
These checks run automatically on commit, but you can also run them manually:
poetry run pre-commit run --all-files