CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
DEPLOY.md
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 8ade77b | 1 | # Deploying Gluecron to Production |
| 2 | ||
| 3644238 | 3 | ## The Green Ecosystem |
| 8ade77b | 4 | |
| 3644238 | 5 | Gluecron is part of the self-hosting ecosystem: |
| 6 | - **Crontech** deploys gluecron (and everything else) | |
| 7 | - **Gluecron** hosts the code for Crontech, GateTest, and itself | |
| 8 | - **GateTest** scans every push to gluecron | |
| 8ade77b | 9 | |
| 3644238 | 10 | Once live, all three services feed each other. Dog food all the way. |
| 11 | ||
| 12 | ## Option A: Deploy via Crontech (recommended) | |
| 13 | ||
| 14 | Since Crontech handles deployment, routing, and SSL: | |
| 15 | ||
| 16 | ```bash | |
| 17 | # 1. Create Neon database at neon.tech (2 minutes) | |
| 18 | # Copy the connection string | |
| 19 | ||
| 20 | # 2. In Crontech, deploy gluecron as a service with: | |
| 21 | # - Repo: ccantynz-alt/Gluecron.com | |
| 22 | # - Branch: claude/ship-fixes-and-tests-Jvz1c | |
| 23 | # - Build: bun install --production | |
| 24 | # - Start: bun run src/index.ts | |
| 25 | # - Port: 3000 | |
| 26 | # | |
| 27 | # Environment variables: | |
| 28 | # DATABASE_URL = postgresql://your-neon-url | |
| 29 | # GIT_REPOS_PATH = /data/repos | |
| 30 | # PORT = 3000 | |
| 31 | # NODE_ENV = production | |
| 32 | # | |
| 33 | # Persistent volume: mount /data/repos (for git repos on disk) | |
| 34 | ||
| 35 | # 3. Run the migration (one time): | |
| 36 | # Paste drizzle/0000_init.sql into Neon's SQL Editor and run it | |
| 37 | ||
| 38 | # 4. Route gluecron.com (or gluecron.crontech.ai) to the service | |
| 39 | ``` | |
| 40 | ||
| 41 | ### Crontech routing options: | |
| 42 | - **Subdomain:** `gluecron.crontech.ai` → fastest to set up | |
| 43 | - **Custom domain:** `gluecron.com` → add CNAME to Crontech in DNS | |
| 44 | ||
| fc0785e | 45 | ## Option B: Direct Deploy (any Linux server) |
| 8ade77b | 46 | |
| 47 | ```bash | |
| 48 | # 1. SSH into your server | |
| 49 | ssh root@your-server-ip | |
| 50 | ||
| 51 | # 2. Set your database URL | |
| 46a3b26 | 52 | export DATABASE_URL="postgresql://host/gluecron?sslmode=require" |
| 8ade77b | 53 | |
| 54 | # 3. Run the deploy script | |
| 55 | curl -fsSL https://raw.githubusercontent.com/ccantynz-alt/Gluecron.com/claude/ship-fixes-and-tests-Jvz1c/scripts/deploy.sh | bash | |
| 56 | ``` | |
| 57 | ||
| 58 | ## Manual Deploy | |
| 59 | ||
| 60 | ### Step 1: Database | |
| 61 | ||
| 62 | 1. Go to https://neon.tech and create a project called "gluecron" | |
| 63 | 2. Copy the connection string | |
| 64 | 3. Run the migration: | |
| 65 | ```bash | |
| 66 | psql "your-connection-string" -f drizzle/0000_init.sql | |
| 67 | ``` | |
| 68 | ||
| 69 | ### Step 2: Server Setup | |
| 70 | ||
| 71 | ```bash | |
| 72 | # Install Bun | |
| 73 | curl -fsSL https://bun.sh/install | bash | |
| 74 | ||
| 75 | # Install git | |
| 76 | apt-get update && apt-get install -y git | |
| 77 | ||
| 78 | # Clone the repo | |
| 79 | git clone --branch claude/ship-fixes-and-tests-Jvz1c \ | |
| 80 | https://github.com/ccantynz-alt/Gluecron.com.git /opt/gluecron | |
| 81 | cd /opt/gluecron | |
| 82 | ||
| 83 | # Create .env | |
| 84 | cat > .env << EOF | |
| 46a3b26 | 85 | DATABASE_URL=postgresql://host/gluecron?sslmode=require |
| 8ade77b | 86 | GIT_REPOS_PATH=/data/repos |
| 87 | PORT=3000 | |
| 88 | NODE_ENV=production | |
| 89 | GATETEST_URL=https://gatetest.ai/api/scan/run | |
| 90 | CRONTECH_DEPLOY_URL=https://crontech.ai/api/trpc/tenant.deploy | |
| 91 | EOF | |
| 92 | ||
| 93 | # Install dependencies | |
| 94 | bun install --production | |
| 95 | ||
| 96 | # Create repos directory | |
| 97 | mkdir -p /data/repos | |
| 98 | ||
| 99 | # Start the server | |
| 100 | bun run src/index.ts | |
| 101 | ``` | |
| 102 | ||
| 103 | ### Step 3: HTTPS with Nginx | |
| 104 | ||
| 105 | ```bash | |
| 106 | bash scripts/setup-nginx.sh gluecron.com | |
| 107 | ``` | |
| 108 | ||
| 109 | ### Step 4: Systemd (keep it running) | |
| 110 | ||
| 111 | ```bash | |
| 112 | # The deploy script creates this, but manually: | |
| 113 | cat > /etc/systemd/system/gluecron.service << EOF | |
| 114 | [Unit] | |
| 115 | Description=Gluecron | |
| 116 | After=network.target | |
| 117 | ||
| 118 | [Service] | |
| 119 | Type=simple | |
| 120 | WorkingDirectory=/opt/gluecron | |
| 121 | EnvironmentFile=/opt/gluecron/.env | |
| 122 | ExecStart=/root/.bun/bin/bun run src/index.ts | |
| 123 | Restart=always | |
| 124 | RestartSec=5 | |
| 125 | ||
| 126 | [Install] | |
| 127 | WantedBy=multi-user.target | |
| 128 | EOF | |
| 129 | ||
| 130 | systemctl daemon-reload | |
| 131 | systemctl enable gluecron | |
| 132 | systemctl start gluecron | |
| 133 | ``` | |
| 134 | ||
| 135 | ## Docker Deploy | |
| 136 | ||
| 137 | ```bash | |
| 138 | # Create .env file with DATABASE_URL | |
| 139 | echo "DATABASE_URL=postgresql://..." > .env | |
| 140 | ||
| 141 | # Build and run | |
| 142 | docker compose up -d | |
| 143 | ||
| 144 | # Run migration | |
| 145 | docker compose exec gluecron bun run -e "..." | |
| 146 | # Or connect directly to Neon and run drizzle/0000_init.sql | |
| 147 | ``` | |
| 148 | ||
| 149 | ## Operations | |
| 150 | ||
| 151 | ```bash | |
| 152 | # View logs | |
| 153 | journalctl -u gluecron -f | |
| 154 | ||
| 155 | # Restart | |
| 156 | systemctl restart gluecron | |
| 157 | ||
| 158 | # Update to latest | |
| 159 | cd /opt/gluecron | |
| 160 | git pull origin claude/ship-fixes-and-tests-Jvz1c | |
| 161 | bun install | |
| 162 | systemctl restart gluecron | |
| 163 | ``` | |
| 164 | ||
| 165 | ## Verification Checklist | |
| 166 | ||
| 167 | After deploy, verify: | |
| 168 | ||
| 169 | - [ ] `curl http://localhost:3000` returns the landing page | |
| 170 | - [ ] Register an account at /register | |
| 171 | - [ ] Create a repo at /new | |
| 172 | - [ ] `git clone http://gluecron.com/youruser/yourrepo.git` works | |
| 173 | - [ ] Push code and see it in the web UI | |
| 174 | - [ ] Health dashboard shows at /youruser/yourrepo/health | |
| 46a3b26 | 175 | - [ ] HTTPS works (if nginx + certbot set up) |