Skip to content

Commit 4ced7fa

Browse files
Merge pull request #2 from xploitoverload/copilot/convert-project-to-public
Add deployment infrastructure and public repository configuration
2 parents a0669a2 + 40ec9c5 commit 4ced7fa

17 files changed

Lines changed: 2098 additions & 34 deletions

.dockerignore

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.gitattributes
5+
6+
# CI/CD
7+
.github
8+
9+
# Documentation
10+
*.md
11+
docs/
12+
13+
# Python
14+
__pycache__
15+
*.py[cod]
16+
*$py.class
17+
*.so
18+
.Python
19+
*.egg-info/
20+
dist/
21+
build/
22+
*.egg
23+
24+
# Virtual Environments
25+
venv/
26+
env/
27+
ENV/
28+
.venv/
29+
.virtualenv/
30+
31+
# IDE
32+
.idea/
33+
.vscode/
34+
*.swp
35+
*.swo
36+
*~
37+
.spyproject
38+
.spyderproject
39+
40+
# Testing
41+
.pytest_cache/
42+
.coverage
43+
coverage.xml
44+
*.cover
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
49+
# Database (will be created in container or use external)
50+
*.db
51+
*.sqlite3
52+
instance/
53+
54+
# Logs (will be created in container)
55+
logs/
56+
*.log
57+
58+
# Environment files (use Docker secrets/env vars instead)
59+
.env
60+
.env.*
61+
*.env
62+
63+
# OS
64+
.DS_Store
65+
Thumbs.db
66+
67+
# Uploads (use volumes or external storage)
68+
uploads/
69+
media/
70+
71+
# Temporary files
72+
*.tmp
73+
*.temp
74+
tmp/
75+
temp/
76+
77+
# Security
78+
*.pem
79+
*.key
80+
*.crt
81+
82+
# Docker
83+
Dockerfile
84+
docker-compose.yml
85+
.dockerignore
86+
87+
# Backup files
88+
*.backup
89+
*.bak
90+
*.old
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Bug Report
2+
description: File a bug report to help us improve
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this bug report!
12+
13+
- type: textarea
14+
id: what-happened
15+
attributes:
16+
label: What happened?
17+
description: A clear and concise description of what the bug is
18+
placeholder: Tell us what you see!
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: reproduce
24+
attributes:
25+
label: Steps to Reproduce
26+
description: Steps to reproduce the behavior
27+
placeholder: |
28+
1. Go to '...'
29+
2. Click on '....'
30+
3. Scroll down to '....'
31+
4. See error
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: expected
37+
attributes:
38+
label: Expected behavior
39+
description: A clear and concise description of what you expected to happen
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
id: screenshots
45+
attributes:
46+
label: Screenshots
47+
description: If applicable, add screenshots to help explain your problem
48+
49+
- type: dropdown
50+
id: deployment
51+
attributes:
52+
label: Deployment Method
53+
description: How are you running the application?
54+
options:
55+
- Docker
56+
- Docker Compose
57+
- Heroku
58+
- Render
59+
- Railway
60+
- Local Development
61+
- VPS/Manual
62+
- Other
63+
validations:
64+
required: true
65+
66+
- type: input
67+
id: python-version
68+
attributes:
69+
label: Python Version
70+
description: What version of Python are you using?
71+
placeholder: "e.g., 3.11"
72+
validations:
73+
required: true
74+
75+
- type: input
76+
id: os
77+
attributes:
78+
label: Operating System
79+
description: What OS are you using?
80+
placeholder: "e.g., Ubuntu 22.04, macOS 13, Windows 11"
81+
validations:
82+
required: true
83+
84+
- type: textarea
85+
id: logs
86+
attributes:
87+
label: Relevant log output
88+
description: Please copy and paste any relevant log output
89+
render: shell
90+
91+
- type: textarea
92+
id: additional
93+
attributes:
94+
label: Additional context
95+
description: Add any other context about the problem here
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to suggest a new feature!
12+
13+
- type: textarea
14+
id: problem
15+
attributes:
16+
label: Is your feature request related to a problem?
17+
description: A clear and concise description of what the problem is
18+
placeholder: I'm always frustrated when...
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: solution
24+
attributes:
25+
label: Describe the solution you'd like
26+
description: A clear and concise description of what you want to happen
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: alternatives
32+
attributes:
33+
label: Describe alternatives you've considered
34+
description: A clear and concise description of any alternative solutions or features you've considered
35+
36+
- type: dropdown
37+
id: priority
38+
attributes:
39+
label: Priority
40+
description: How important is this feature to you?
41+
options:
42+
- Low - Nice to have
43+
- Medium - Would be helpful
44+
- High - Critical for my use case
45+
validations:
46+
required: true
47+
48+
- type: checkboxes
49+
id: contribution
50+
attributes:
51+
label: Contribution
52+
description: Are you willing to contribute to this feature?
53+
options:
54+
- label: I'm willing to submit a PR for this feature
55+
- label: I can help test this feature
56+
- label: I can help with documentation
57+
58+
- type: textarea
59+
id: additional
60+
attributes:
61+
label: Additional context
62+
description: Add any other context, mockups, or screenshots about the feature request here

.github/workflows/ci-cd.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
# Job 1: Lint and Test
11+
test:
12+
name: Lint and Test
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
python-version: ['3.9', '3.10', '3.11']
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: 'pip'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements.txt
33+
pip install pytest pytest-cov flake8
34+
35+
- name: Lint with flake8
36+
run: |
37+
# Stop the build if there are Python syntax errors or undefined names
38+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=venv,env,.venv,.git,__pycache__
39+
# Exit-zero treats all errors as warnings
40+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=venv,env,.venv,.git,__pycache__
41+
42+
- name: Run tests
43+
run: |
44+
pytest tests/ -v --cov=app --cov-report=xml --cov-report=term
45+
env:
46+
FLASK_ENV: testing
47+
SECRET_KEY: test-secret-key
48+
49+
- name: Upload coverage to Codecov
50+
uses: codecov/codecov-action@v3
51+
with:
52+
file: ./coverage.xml
53+
fail_ci_if_error: false
54+
55+
# Job 2: Security Scan
56+
security:
57+
name: Security Scan
58+
runs-on: ubuntu-latest
59+
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v4
66+
with:
67+
python-version: '3.11'
68+
69+
- name: Install safety
70+
run: pip install safety
71+
72+
- name: Run safety check
73+
run: safety check --json || true
74+
75+
- name: Run Bandit security scan
76+
run: |
77+
pip install bandit
78+
bandit -r . -f json -o bandit-report.json || true
79+
80+
- name: Upload security reports
81+
uses: actions/upload-artifact@v3
82+
if: always()
83+
with:
84+
name: security-reports
85+
path: |
86+
bandit-report.json
87+
88+
# Job 3: Build Docker Image
89+
build:
90+
name: Build Docker Image
91+
runs-on: ubuntu-latest
92+
needs: [test, security]
93+
if: github.event_name == 'push'
94+
95+
steps:
96+
- name: Checkout code
97+
uses: actions/checkout@v4
98+
99+
- name: Set up Docker Buildx
100+
uses: docker/setup-buildx-action@v3
101+
102+
- name: Login to Docker Hub
103+
if: github.ref == 'refs/heads/main'
104+
uses: docker/login-action@v3
105+
with:
106+
username: ${{ secrets.DOCKER_USERNAME }}
107+
password: ${{ secrets.DOCKER_PASSWORD }}
108+
109+
- name: Build and push Docker image
110+
uses: docker/build-push-action@v5
111+
with:
112+
context: .
113+
push: ${{ github.ref == 'refs/heads/main' }}
114+
tags: |
115+
${{ secrets.DOCKER_USERNAME }}/project-management:latest
116+
${{ secrets.DOCKER_USERNAME }}/project-management:${{ github.sha }}
117+
cache-from: type=gha
118+
cache-to: type=gha,mode=max
119+
120+
- name: Test Docker image
121+
run: |
122+
docker build -t project-management:test .
123+
docker run -d -p 8000:8000 --name test-container project-management:test
124+
sleep 10
125+
curl http://localhost:8000/health || exit 1
126+
docker stop test-container
127+
128+
# Job 4: Deploy to Render (optional)
129+
deploy-render:
130+
name: Deploy to Render
131+
runs-on: ubuntu-latest
132+
needs: build
133+
if: github.ref == 'refs/heads/main'
134+
135+
steps:
136+
- name: Trigger Render Deployment
137+
if: secrets.RENDER_DEPLOY_HOOK_URL != ''
138+
run: |
139+
curl -X POST "${{ secrets.RENDER_DEPLOY_HOOK_URL }}"
140+
141+
- name: Deployment notification
142+
run: echo "Deployment triggered to Render"

0 commit comments

Comments
 (0)