Skip to content

Commit a865850

Browse files
Feature/enhance install sh (#87)
* feat: implement smart auto-detection installer for intuitive UX Replaced complex command-line parameters with intuitive auto-detection: 🎯 Smart Mode Detection: - sudo bash = Production mode (systemd service) - bash = Personal mode (user config) - No more confusing `-s -- --production` parameters 🚀 Clean User Experience: Before: curl -sSL url | bash -s -- --production (intimidating) After: curl -sSL url | sudo bash (intuitive) ✨ Enhanced Features: - Auto-detects user intent from execution context - Provides helpful hints for production setup - Maintains backwards compatibility for advanced options - Clear messaging about what mode is detected 📖 Updated Documentation: - Simplified Quick Start to 2-line production setup - Added Personal Setup section for developers - Clean, familiar syntax that matches industry standards Usage examples: # Production (natural with sudo) curl -sSL https://go.ainun.cloud/tenangdb-install.sh | sudo bash # Personal (natural without sudo) curl -sSL https://go.ainun.cloud/tenangdb-install.sh | bash # Advanced (backwards compatible) curl -sSL https://go.ainun.cloud/tenangdb-install.sh | bash -s -- --skip-deps 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * feat: update readme with ft_transcendence template style * fix: update readme more shorter * feat: divide docker and troubleshoot command * fix: my full name * fix: docs validation check --------- Co-authored-by: Claude <[email protected]>
1 parent f93f8f3 commit a865850

File tree

5 files changed

+927
-495
lines changed

5 files changed

+927
-495
lines changed

.github/workflows/docs.yml

Lines changed: 141 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Documentation
22

3+
# Validates documentation structure, links, YAML syntax, and quality
4+
# Updated to support new clean README.md structure with separate doc files
5+
36
on:
47
push:
58
branches: [ main ]
@@ -40,7 +43,7 @@ jobs:
4043
fi
4144
4245
# Check if README.md contains required sections
43-
required_sections=("Quick Start" "Config" "Features" "Commands")
46+
required_sections=("Quick Start" "Key Features" "Documentation" "Basic Usage")
4447
for section in "${required_sections[@]}"; do
4548
if ! grep -q "## .*$section" README.md; then
4649
echo "❌ Missing section: $section"
@@ -100,19 +103,103 @@ jobs:
100103
echo "🔍 Checking documentation links..."
101104
102105
# Check if referenced documentation files exist
103-
docs_files=("INSTALL.md" "DOCKER.md" "MYSQL_USER_SETUP.md" "PRODUCTION_DEPLOYMENT.md")
106+
docs_files=(
107+
"INSTALL.md"
108+
"DOCKER.md"
109+
"TROUBLESHOOTING.md"
110+
"MYSQL_USER_SETUP.md"
111+
"PRODUCTION_DEPLOYMENT.md"
112+
"docs/COMMANDS.md"
113+
"config.yaml.example"
114+
)
115+
116+
missing_files=()
117+
found_files=()
118+
104119
for doc in "${docs_files[@]}"; do
105120
if grep -q "$doc" README.md; then
106121
if [ ! -f "$doc" ]; then
107-
echo "⚠️ Referenced but missing: $doc"
122+
missing_files+=("$doc")
123+
echo "❌ Referenced but missing: $doc"
108124
else
125+
found_files+=("$doc")
109126
echo "✅ Found: $doc"
110127
fi
111128
fi
112129
done
113130
131+
# Check for new documentation files that should be referenced
132+
new_docs=("TROUBLESHOOTING.md" "DOCKER.md")
133+
for doc in "${new_docs[@]}"; do
134+
if [ -f "$doc" ] && ! grep -q "$doc" README.md; then
135+
echo "⚠️ Documentation file exists but not referenced in README: $doc"
136+
fi
137+
done
138+
139+
if [ ${#missing_files[@]} -gt 0 ]; then
140+
echo "❌ Missing ${#missing_files[@]} referenced files"
141+
exit 1
142+
fi
143+
114144
echo "✅ Documentation links check completed"
115145
146+
- name: Validate documentation structure
147+
run: |
148+
echo "🔍 Validating documentation structure..."
149+
150+
# Check TROUBLESHOOTING.md structure
151+
if [ -f "TROUBLESHOOTING.md" ]; then
152+
echo "Checking TROUBLESHOOTING.md..."
153+
required_sections=("Common Issues" "MySQL Setup" "Docker Issues" "Getting Help")
154+
for section in "${required_sections[@]}"; do
155+
if ! grep -q "## .*$section" TROUBLESHOOTING.md; then
156+
echo "⚠️ TROUBLESHOOTING.md missing section: $section"
157+
else
158+
echo "✅ Found section: $section"
159+
fi
160+
done
161+
fi
162+
163+
# Check DOCKER.md structure
164+
if [ -f "DOCKER.md" ]; then
165+
echo "Checking DOCKER.md..."
166+
required_sections=("Quick Start" "Interactive Setup" "Networking" "Volume Mounts")
167+
for section in "${required_sections[@]}"; do
168+
if ! grep -q "## .*$section" DOCKER.md; then
169+
echo "⚠️ DOCKER.md missing section: $section"
170+
else
171+
echo "✅ Found section: $section"
172+
fi
173+
done
174+
fi
175+
176+
# Check if Docker examples are properly formatted
177+
if [ -f "DOCKER.md" ]; then
178+
if ! grep -q "docker pull ghcr.io/abdullahainun/tenangdb:latest" DOCKER.md; then
179+
echo "⚠️ DOCKER.md missing verified docker pull command"
180+
else
181+
echo "✅ Docker pull command found"
182+
fi
183+
fi
184+
185+
# Validate README.md links point to existing files
186+
echo "Checking README.md documentation links..."
187+
while IFS= read -r line; do
188+
if [[ $line =~ \[.*\]\(([^)]+)\) ]]; then
189+
link="${BASH_REMATCH[1]}"
190+
# Skip external URLs and anchors
191+
if [[ ! $link =~ ^https?:// ]] && [[ ! $link =~ ^# ]] && [[ $link != *"#"* ]]; then
192+
if [ ! -f "$link" ] && [ ! -d "$link" ]; then
193+
echo "⚠️ Broken link in README.md: $link"
194+
else
195+
echo "✅ Valid link: $link"
196+
fi
197+
fi
198+
fi
199+
done < README.md
200+
201+
echo "✅ Documentation structure validation completed"
202+
116203
- name: Validate Docker Compose
117204
if: hashFiles('docker-compose.yml') != ''
118205
run: |
@@ -159,6 +246,57 @@ jobs:
159246
"
160247
161248
echo "✅ Docker Compose validation completed"
249+
250+
- name: Check documentation quality
251+
run: |
252+
echo "🔍 Checking documentation quality..."
253+
254+
# Check README.md length (should be concise)
255+
readme_lines=$(wc -l < README.md)
256+
if [ $readme_lines -gt 100 ]; then
257+
echo "⚠️ README.md is quite long ($readme_lines lines). Consider moving content to separate files."
258+
else
259+
echo "✅ README.md length is appropriate ($readme_lines lines)"
260+
fi
261+
262+
# Check for consistent emoji usage
263+
if ! grep -q "🛡️" README.md; then
264+
echo "⚠️ Missing main project emoji (🛡️) in README.md"
265+
else
266+
echo "✅ Main project emoji found"
267+
fi
268+
269+
# Check for installation commands
270+
if ! grep -q "curl.*tenangdb-install.sh" README.md; then
271+
echo "⚠️ Missing installation command in README.md"
272+
else
273+
echo "✅ Installation command found"
274+
fi
275+
276+
# Check for demo link
277+
if ! grep -q "asciinema.org" README.md; then
278+
echo "⚠️ Missing demo link in README.md"
279+
else
280+
echo "✅ Demo link found"
281+
fi
282+
283+
# Check for proper badge formatting
284+
badge_count=$(grep -c "shields.io\|img.shields.io" README.md || true)
285+
if [ $badge_count -lt 3 ]; then
286+
echo "⚠️ Less than 3 badges found ($badge_count). Consider adding more status badges."
287+
else
288+
echo "✅ Found $badge_count badges"
289+
fi
290+
291+
# Check for proper code block formatting
292+
bash_blocks=$(grep -c "```bash" README.md || true)
293+
if [ $bash_blocks -lt 3 ]; then
294+
echo "⚠️ Few bash code blocks found ($bash_blocks). Users need clear examples."
295+
else
296+
echo "✅ Found $bash_blocks bash code blocks"
297+
fi
298+
299+
echo "✅ Documentation quality check completed"
162300
163301
status-check:
164302
name: Documentation Status Check

0 commit comments

Comments
 (0)