Commite1309d5unknown_key
feat(phase-b): gluecron-on-gluecron migration tooling
feat(phase-b): gluecron-on-gluecron migration tooling Three artifacts that turn gluecron into a self-hosting product the moment gluecron.com is live: .gluecron/workflows/deploy.yml - Gluecron's first self-hosted workflow file. Replaces the GitHub Action vultr-deploy.yml step-for-step. When gluecron's own workflow runner picks this up on a push to main, it runs deploy-crontech.sh locally on the box (no SSH gymnastics needed since the runner and target are the same VPS). - Pull, run deploy script, smoke-test /healthz with retries. scripts/migrate-to-gluecron.ps1 - One-command Windows migration. Verifies gluecron.com is live, prompts for a PAT, calls /import/github/repo to mirror the repo, prints the git remote command and Claude Desktop MCP config snippet. MIGRATE_TO_GLUECRON.md - Phase B (mirror onto gluecron, both remotes coexist) and Phase C (cut the cord, archive GitHub) documented end-to-end. Rollback is one git push origin main away. Net: after the user runs migrate-to-gluecron.ps1, every push goes to gluecron's own platform first; GitHub becomes downstream, then archived.
3 files changed+219−0e1309d5afae59111ba4af1e1f200f065af207e9d
3 changed files+219−0
Added.gluecron/workflows/deploy.yml+39−0View fileUnifiedSplit
@@ -0,0 +1,39 @@
1name: Deploy gluecron to itself
2# This is gluecron's first self-hosted workflow. When pushed to gluecron.com's
3# git endpoint, gluecron's own workflow runner picks this up and runs it.
4# Replaces the GitHub Action `vultr-deploy.yml` step for step.
5#
6# Trigger: every push to main.
7# Effect: pulls latest, runs the production deploy script, smoke-tests.
8
9on:
10 push:
11 branches: [main]
12
13jobs:
14 deploy:
15 runs-on: self
16 steps:
17 - name: Pull latest main onto the box
18 run: |
19 cd /opt/gluecron
20 git fetch --prune origin main
21 git reset --hard origin/main
22 echo "Deploying SHA: $(git rev-parse HEAD)"
23
24 - name: Run production deploy script
25 run: bash /opt/gluecron/scripts/deploy-crontech.sh
26
27 - name: Smoke test
28 run: |
29 for i in 1 2 3 4 5 6 7 8; do
30 code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3001/healthz)
31 echo "Attempt $i: /healthz -> $code"
32 if [ "$code" = "200" ]; then
33 echo "OK"
34 exit 0
35 fi
36 sleep 8
37 done
38 echo "Smoke failed"
39 exit 1
AddedMIGRATE_TO_GLUECRON.md+65−0View fileUnifiedSplit
@@ -0,0 +1,65 @@
1# Migrating gluecron off GitHub onto itself
2
3This is the dogfooding play. The pitch is "GitHub replacement for AI-native software" — and right now gluecron's own source code lives on GitHub. This doc is the path to fix that.
4
5## Prerequisites
6
7- `gluecron.com` is live and responding 200 on `/healthz`
8- You have an admin account registered on gluecron.com (the first user with username matching `SITE_ADMIN_USERNAME` env auto-becomes site admin; default is `ccantynz-alt`)
9
10If gluecron.com is still 502, see the platform-status section in `LAUNCH_TODAY.md` first.
11
12## Phase B — gluecron-on-gluecron (ship today)
13
14This phase mirrors the repo onto gluecron.com without abandoning GitHub. Both stay in sync until you're confident enough to cut the cord.
15
16### One command
17
18```powershell
19.\scripts\migrate-to-gluecron.ps1
20```
21
22It will:
23
241. Verify `gluecron.com` is live
252. Prompt for your PAT (generate at `/settings/tokens`)
263. Trigger a `/import/github/repo` mirror of `ccantynz-alt/Gluecron.com` onto gluecron
274. Print the `git remote add gluecron` command for your local clone
285. Print the Claude Desktop / Cursor MCP config snippet so Claude switches from GitHub MCP to gluecron's MCP
29
30After this:
31
32- The repo is browsable at `https://gluecron.com/ccantynz-alt/Gluecron.com`
33- You can `git push gluecron main` — both remotes stay in sync
34- Claude Code can `read_file`, `list_issues`, `search_repo`, etc. against gluecron instead of GitHub once you swap the MCP config
35
36### Workflow runner takes over deploys (incremental)
37
38The repo now ships `.gluecron/workflows/deploy.yml` — the gluecron-native equivalent of `.github/workflows/vultr-deploy.yml`. When gluecron's workflow runner picks it up on a push to main, it runs the same deploy steps locally on the box (no SSH-from-runner gymnastics — gluecron and the deploy target are on the same machine, so the workflow runner runs `bash scripts/deploy-crontech.sh` directly).
39
40For now both `.github/workflows/vultr-deploy.yml` (GitHub) and `.gluecron/workflows/deploy.yml` (gluecron) coexist. After a week of clean deploys via gluecron's runner, delete the GitHub Action.
41
42## Phase C — cut the GitHub cord (after a week of stable Phase B)
43
44When you trust the gluecron-side enough:
45
461. Migrate any active GitHub issues to gluecron (the import flow handles past issues automatically; only WIP discussions need manual moves)
472. Migrate active PRs (rebase onto a gluecron-side branch, push there)
483. Delete `.github/workflows/vultr-deploy.yml` and `.github/workflows/fly-deploy.yml`
494. Set the GitHub repo to read-only / archive
505. Update `package.json` `repository.url`, `README.md` install instructions, and any other GitHub references to point at `gluecron.com/ccantynz-alt/Gluecron.com`
516. Done. Gluecron now hosts gluecron.
52
53## Rollback at any time
54
55The migration is non-destructive. The GitHub repo stays untouched. If gluecron-on-gluecron has a problem:
56
57- `git push origin main` (GitHub) still works
58- `.github/workflows/vultr-deploy.yml` still deploys
59- The gluecron-side mirror just falls behind until you re-sync
60
61You can also delete the gluecron-side repo entirely from `/settings` and start over.
62
63## Why this matters
64
65Every day gluecron's code lives on GitHub is a day the product can't truly say "GitHub replacement." This phase is mostly about credibility and trust — but it's also a forcing function. Bugs in gluecron's hosting / PR flow / workflow runner that you'd never hit as a casual self-hoster will surface immediately when *you* are the user.
Addedscripts/migrate-to-gluecron.ps1+115−0View fileUnifiedSplit
@@ -0,0 +1,115 @@
1# =============================================================================
2# Migrate gluecron to itself — Phase B
3# Runs from Windows / PowerShell. Mirrors the GitHub repo onto gluecron.com,
4# wires git remote, prints the Claude Code MCP config snippet.
5# =============================================================================
6#
7# Prerequisites:
8# - gluecron.com responds 200 on /healthz
9# - ccantynz-alt account registered on gluecron.com (becomes site admin
10# automatically via SITE_ADMIN_USERNAME env var)
11# - You have a Personal Access Token at /settings/tokens on gluecron.com
12#
13# Run: .\scripts\migrate-to-gluecron.ps1
14# =============================================================================
15
16$ErrorActionPreference = "Stop"
17
18$GLUECRON = "https://gluecron.com"
19$GH_OWNER = "ccantynz-alt"
20$GH_REPO = "Gluecron.com"
21$GLUECRON_OWNER = "ccantynz-alt"
22
23Write-Host "==> Phase B: Migrate gluecron to itself" -ForegroundColor Cyan
24Write-Host ""
25
26# ─── 1. Verify gluecron.com is live ─────────────────────────────────────────
27Write-Host "[1/5] Verifying gluecron.com is live..."
28try {
29 $health = Invoke-RestMethod -Uri "$GLUECRON/healthz" -TimeoutSec 10
30 Write-Host " ✓ gluecron.com /healthz responded" -ForegroundColor Green
31} catch {
32 Write-Host " ✗ gluecron.com is not responding. Fix Phase A first." -ForegroundColor Red
33 exit 1
34}
35
36# ─── 2. PAT prompt ──────────────────────────────────────────────────────────
37Write-Host "[2/5] Personal Access Token..."
38Write-Host " Open in browser: $GLUECRON/settings/tokens" -ForegroundColor Yellow
39Write-Host " Generate a token with full scope, copy it, paste below." -ForegroundColor Yellow
40$secureToken = Read-Host " PAT" -AsSecureString
41$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureToken)
42$PAT = [Runtime.InteropServices.Marshal]::PtrToStringAuto($ptr)
43[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr) | Out-Null
44if (-not $PAT -or $PAT.Length -lt 10) {
45 Write-Host " ✗ Empty / suspicious PAT, aborting." -ForegroundColor Red
46 exit 1
47}
48
49# Verify PAT works
50try {
51 $me = Invoke-RestMethod -Uri "$GLUECRON/api/v2/me" -Headers @{ Authorization = "Bearer $PAT" } -TimeoutSec 10
52 Write-Host " ✓ Authenticated as: $($me.username)" -ForegroundColor Green
53} catch {
54 Write-Host " ✗ PAT failed auth. Verify the token at $GLUECRON/settings/tokens." -ForegroundColor Red
55 exit 1
56}
57
58# ─── 3. Trigger import from GitHub ──────────────────────────────────────────
59Write-Host "[3/5] Importing $GH_OWNER/$GH_REPO from GitHub..."
60$importBody = @{
61 source = "github"
62 owner = $GH_OWNER
63 repo = $GH_REPO
64} | ConvertTo-Json
65try {
66 $imported = Invoke-RestMethod -Method POST -Uri "$GLUECRON/import/github/repo" `
67 -Headers @{ Authorization = "Bearer $PAT" } `
68 -ContentType "application/json" `
69 -Body $importBody -TimeoutSec 120
70 Write-Host " ✓ Repo mirrored to $GLUECRON/$GLUECRON_OWNER/$GH_REPO" -ForegroundColor Green
71} catch {
72 $resp = $_.Exception.Response
73 if ($resp -and $resp.StatusCode -eq 409) {
74 Write-Host " ✓ Already imported (409 conflict is fine)" -ForegroundColor Yellow
75 } else {
76 Write-Host " ✗ Import failed: $_" -ForegroundColor Red
77 Write-Host " You can also import manually at $GLUECRON/import"
78 exit 1
79 }
80}
81
82# ─── 4. Output git remote command ───────────────────────────────────────────
83Write-Host "[4/5] Git remote setup..."
84$remoteUrl = "$GLUECRON/$GLUECRON_OWNER/$GH_REPO.git"
85Write-Host " In a clone of the repo, run:" -ForegroundColor Yellow
86Write-Host " git remote add gluecron $remoteUrl"
87Write-Host " git push -u gluecron main"
88Write-Host ""
89
90# ─── 5. Output MCP config ───────────────────────────────────────────────────
91Write-Host "[5/5] Claude Code / Cursor MCP config..."
92Write-Host " Add this to your Claude Desktop config (claude_desktop_config.json):" -ForegroundColor Yellow
93Write-Host ""
94$mcpConfig = @"
95{
96 "mcpServers": {
97 "gluecron": {
98 "command": "npx",
99 "args": ["-y", "mcp-remote", "$GLUECRON/mcp"],
100 "env": {
101 "GLUECRON_TOKEN": "$PAT"
102 }
103 }
104 }
105}
106"@
107Write-Host $mcpConfig -ForegroundColor White
108
109Write-Host ""
110Write-Host "==> Phase B foundation complete." -ForegroundColor Green
111Write-Host " Repo mirrored. From now on you can git push to either remote."
112Write-Host " Phase C (cut the GitHub cord) is unlocked when:"
113Write-Host " - You've pushed to gluecron with no errors for ~1 week"
114Write-Host " - You've moved active issues/PRs over"
115Write-Host " - The .gluecron/workflows/deploy.yml runs cleanly on push"
0116