mirror of
https://github.com/ghndrx/k8s-game-2048.git
synced 2026-02-10 06:45:07 +00:00
- Complete 2048 game implementation with responsive design - Knative Serving manifests for dev/staging/prod environments - Scale-to-zero configuration with environment-specific settings - Custom domain mapping for wa.darknex.us subdomains - GitHub Actions workflows for CI/CD - Docker container with nginx and health checks - Setup scripts for Knative and Kourier installation - GHCR integration for container registry
3.6 KiB
3.6 KiB
Contributing to K8s Game 2048
Thank you for considering contributing to this project! This guide will help you get started.
Development Setup
-
Clone the repository
git clone https://github.com/your-username/k8s-game-2048.git cd k8s-game-2048 -
Local Development
# Start local development server npm start # Or with Python python3 -m http.server 8080 --directory src -
Build Docker Image
npm run build # Or docker build -t k8s-game-2048 .
Git Workflow
We use a GitFlow-inspired workflow:
main- Production-ready code, deployed to staging automaticallydevelop- Development branch, deployed to dev environment automaticallyfeature/*- Feature branches, create PR to develophotfix/*- Hotfix branches, create PR to mainrelease/*- Release branches for production deployment
Branch Protection Rules
main: Requires PR review, all checks must passdevelop: Requires PR review, all checks must pass
Deployment Environments
| Environment | Branch | Domain | Auto-Deploy |
|---|---|---|---|
| Development | develop |
2048-dev.wa.darknex.us |
✅ |
| Staging | main |
2048-staging.wa.darknex.us |
✅ |
| Production | tags |
2048.wa.darknex.us |
Manual |
Making Changes
For New Features
-
Create a feature branch from
develop:git checkout develop git pull origin develop git checkout -b feature/your-feature-name -
Make your changes and commit:
git add . git commit -m "feat: add your feature description" -
Push and create a PR to
develop:git push origin feature/your-feature-name
For Bug Fixes
-
Create a hotfix branch from
main:git checkout main git pull origin main git checkout -b hotfix/fix-description -
Make your changes and create PR to
main
Commit Convention
We use Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Testing
Local Testing
# Test the game locally
npm start
open http://localhost:8080
Kubernetes Testing
# Deploy to development environment
kubectl apply -f manifests/dev/
# Check deployment status
kubectl get ksvc -n game-2048-dev
# Test the deployed service
curl -f https://2048-dev.wa.darknex.us/
Code Style
- Use 2 spaces for indentation
- Use meaningful variable and function names
- Add comments for complex logic
- Keep functions small and focused
Pull Request Process
- Title: Use conventional commit format
- Description:
- What changes were made?
- Why were they made?
- How to test the changes?
- Testing: Ensure all environments work correctly
- Documentation: Update README if needed
Release Process
-
Create a release branch from
main:git checkout main git pull origin main git checkout -b release/v1.1.0 -
Update version in
package.json -
Create PR to
main -
After merge, create a GitHub release with tag
-
Production deployment will trigger automatically
Getting Help
- Open an issue for bugs or feature requests
- Start a discussion for questions
- Check existing issues before creating new ones
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.