Website-creator: always create locally first, then ask to sync
This commit is contained in:
@@ -811,14 +811,15 @@ python3 scripts/create_astro_website.py \
|
|||||||
--features "blog,products,contact" \
|
--features "blog,products,contact" \
|
||||||
--umami-id "xxx-xxx-xxx" \
|
--umami-id "xxx-xxx-xxx" \
|
||||||
--output "./dealplustech-website"
|
--output "./dealplustech-website"
|
||||||
|
|
||||||
# Local only (skip Gitea/Easypanel):
|
|
||||||
python3 scripts/create_astro_website.py \
|
|
||||||
--name "My Website" \
|
|
||||||
--local-only \
|
|
||||||
--output "./my-website"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Workflow:**
|
||||||
|
1. Creates website locally
|
||||||
|
2. Shows preview instructions (npm run dev)
|
||||||
|
3. Asks: "Sync to Gitea and deploy?"
|
||||||
|
- **No:** Stay local, you're done
|
||||||
|
- **Yes:** Proceed with Gitea sync + Easypanel deploy
|
||||||
|
|
||||||
### Refactor Existing Website
|
### Refactor Existing Website
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Creates complete Astro projects with:
|
|||||||
- Cookie consent management
|
- Cookie consent management
|
||||||
- Consent logging database (Astro DB)
|
- Consent logging database (Astro DB)
|
||||||
- PDPA-compliant legal pages
|
- PDPA-compliant legal pages
|
||||||
- Easypanel deployment (optional with --local-only)
|
- Easypanel deployment (manual sync after local preview)
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
python3 create_astro_website.py \\
|
python3 create_astro_website.py \\
|
||||||
@@ -19,11 +19,8 @@ Usage:
|
|||||||
--languages "th,en" \\
|
--languages "th,en" \\
|
||||||
--output "./dealplustech-website"
|
--output "./dealplustech-website"
|
||||||
|
|
||||||
# Local only (skip Gitea/Easypanel):
|
# Then preview locally, and when ready:
|
||||||
python3 create_astro_website.py \\
|
# Script will ask: "Sync to Gitea and deploy?"
|
||||||
--name "My Website" \\
|
|
||||||
--local-only \\
|
|
||||||
--output "./my-website"
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -260,8 +257,6 @@ def main():
|
|||||||
help='Output directory')
|
help='Output directory')
|
||||||
parser.add_argument('--no-interactive', action='store_true',
|
parser.add_argument('--no-interactive', action='store_true',
|
||||||
help='Skip interactive setup (use defaults)')
|
help='Skip interactive setup (use defaults)')
|
||||||
parser.add_argument('--local-only', action='store_true',
|
|
||||||
help='Create website locally only, skip Gitea sync and Easypanel deploy')
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -341,39 +336,32 @@ def main():
|
|||||||
print(" 3. Update .env with your credentials")
|
print(" 3. Update .env with your credentials")
|
||||||
print(" 4. npm run dev")
|
print(" 4. npm run dev")
|
||||||
|
|
||||||
# Check if local-only mode
|
# Always ask to sync (skip if no-interactive mode)
|
||||||
if args.local_only:
|
print("")
|
||||||
print("")
|
print("=" * 60)
|
||||||
print("=" * 60)
|
print("🏠 Website created locally!")
|
||||||
print("🏠 LOCAL MODE - No auto-deploy")
|
print("=" * 60)
|
||||||
print("=" * 60)
|
print("")
|
||||||
print("")
|
print("Preview at: http://localhost:4321")
|
||||||
print("Website created locally. To preview:")
|
print("")
|
||||||
print(f" cd {args.output}")
|
|
||||||
print(" npm install")
|
# Ask if they want to sync to Gitea/Easypanel
|
||||||
print(" npm run dev")
|
if args.no_interactive:
|
||||||
print("")
|
print("✅ Done! Website is ready at:", args.output)
|
||||||
|
print("To sync later, run the sync command manually.")
|
||||||
# Ask if they want to deploy (skip if no-interactive mode)
|
return
|
||||||
if args.no_interactive:
|
|
||||||
print("✅ Done! Website is ready at:", args.output)
|
sync_choice = input("Do you want to sync to Gitea and deploy to Easypanel? (y/n): ").strip().lower()
|
||||||
return
|
|
||||||
|
if sync_choice != 'y':
|
||||||
deploy_choice = input("Do you want to sync to Gitea and deploy to Easypanel? (y/n): ").strip().lower()
|
|
||||||
|
|
||||||
if deploy_choice != 'y':
|
|
||||||
print("")
|
|
||||||
print("✅ Done! Website is ready at:", args.output)
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
print("")
|
|
||||||
print("Proceeding with deployment...")
|
|
||||||
else:
|
|
||||||
print("")
|
|
||||||
print("=" * 60)
|
|
||||||
print("🚀 AUTO-DEPLOY STARTING")
|
|
||||||
print("=" * 60)
|
|
||||||
print("")
|
print("")
|
||||||
|
print("✅ Done! Website is ready at:", args.output)
|
||||||
|
print("To sync later, run this script again or use gitea-sync/easypanel-deploy skills.")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("")
|
||||||
|
print("Proceeding with sync and deployment...")
|
||||||
|
print("")
|
||||||
|
|
||||||
# Step 1: Sync to Gitea
|
# Step 1: Sync to Gitea
|
||||||
print("📦 Step 1/3: Syncing to Gitea...")
|
print("📦 Step 1/3: Syncing to Gitea...")
|
||||||
|
|||||||
Reference in New Issue
Block a user