@_xtribe/cli 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/tribe-deployment.yaml +456 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_xtribe/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "TRIBE multi-agent development system - Zero to productive with one command",
|
|
5
5
|
"main": "install-tribe.js",
|
|
6
6
|
"bin": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"install-tribe.js",
|
|
41
41
|
"setup-path.js",
|
|
42
42
|
"install.sh",
|
|
43
|
+
"tribe-deployment.yaml",
|
|
43
44
|
"README.md",
|
|
44
45
|
"package.json"
|
|
45
46
|
],
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
---
|
|
2
|
+
# TRIBE Complete Deployment - Bundled with NPM Package
|
|
3
|
+
# This file is automatically deployed by 'npx @_xtribe/cli'
|
|
4
|
+
#
|
|
5
|
+
# IMPORTANT: This deployment uses PUBLIC Docker Hub images from tribexal/tribe
|
|
6
|
+
# - tribexal/tribe:latest-taskmaster
|
|
7
|
+
# - tribexal/tribe:latest-bridge
|
|
8
|
+
# - tribexal/tribe:latest-claude-agent
|
|
9
|
+
#
|
|
10
|
+
# DO NOT change these to local image names for the npm package!
|
|
11
|
+
---
|
|
12
|
+
apiVersion: v1
|
|
13
|
+
kind: Namespace
|
|
14
|
+
metadata:
|
|
15
|
+
name: tribe-system
|
|
16
|
+
---
|
|
17
|
+
# ServiceAccount for Bridge
|
|
18
|
+
apiVersion: v1
|
|
19
|
+
kind: ServiceAccount
|
|
20
|
+
metadata:
|
|
21
|
+
name: bridge
|
|
22
|
+
namespace: tribe-system
|
|
23
|
+
---
|
|
24
|
+
# Role for Bridge
|
|
25
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
26
|
+
kind: Role
|
|
27
|
+
metadata:
|
|
28
|
+
name: bridge-role
|
|
29
|
+
namespace: tribe-system
|
|
30
|
+
rules:
|
|
31
|
+
- apiGroups: [""]
|
|
32
|
+
resources: ["pods", "services", "pods/exec", "pods/log", "configmaps", "secrets", "namespaces"]
|
|
33
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
34
|
+
- apiGroups: ["apps"]
|
|
35
|
+
resources: ["deployments", "replicasets"]
|
|
36
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
37
|
+
- apiGroups: ["batch"]
|
|
38
|
+
resources: ["jobs"]
|
|
39
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
40
|
+
---
|
|
41
|
+
# RoleBinding for Bridge
|
|
42
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
43
|
+
kind: RoleBinding
|
|
44
|
+
metadata:
|
|
45
|
+
name: bridge-rolebinding
|
|
46
|
+
namespace: tribe-system
|
|
47
|
+
subjects:
|
|
48
|
+
- kind: ServiceAccount
|
|
49
|
+
name: bridge
|
|
50
|
+
namespace: tribe-system
|
|
51
|
+
roleRef:
|
|
52
|
+
kind: Role
|
|
53
|
+
name: bridge-role
|
|
54
|
+
apiGroup: rbac.authorization.k8s.io
|
|
55
|
+
---
|
|
56
|
+
# PostgreSQL
|
|
57
|
+
apiVersion: apps/v1
|
|
58
|
+
kind: Deployment
|
|
59
|
+
metadata:
|
|
60
|
+
name: postgres
|
|
61
|
+
namespace: tribe-system
|
|
62
|
+
spec:
|
|
63
|
+
replicas: 1
|
|
64
|
+
selector:
|
|
65
|
+
matchLabels:
|
|
66
|
+
app: postgres
|
|
67
|
+
template:
|
|
68
|
+
metadata:
|
|
69
|
+
labels:
|
|
70
|
+
app: postgres
|
|
71
|
+
spec:
|
|
72
|
+
containers:
|
|
73
|
+
- name: postgres
|
|
74
|
+
image: postgres:15
|
|
75
|
+
env:
|
|
76
|
+
- name: POSTGRES_DB
|
|
77
|
+
value: gitea
|
|
78
|
+
- name: POSTGRES_USER
|
|
79
|
+
value: gitea
|
|
80
|
+
- name: POSTGRES_PASSWORD
|
|
81
|
+
value: gitea
|
|
82
|
+
ports:
|
|
83
|
+
- containerPort: 5432
|
|
84
|
+
readinessProbe:
|
|
85
|
+
exec:
|
|
86
|
+
command:
|
|
87
|
+
- pg_isready
|
|
88
|
+
- -U
|
|
89
|
+
- gitea
|
|
90
|
+
initialDelaySeconds: 5
|
|
91
|
+
periodSeconds: 5
|
|
92
|
+
---
|
|
93
|
+
apiVersion: v1
|
|
94
|
+
kind: Service
|
|
95
|
+
metadata:
|
|
96
|
+
name: postgres
|
|
97
|
+
namespace: tribe-system
|
|
98
|
+
spec:
|
|
99
|
+
selector:
|
|
100
|
+
app: postgres
|
|
101
|
+
ports:
|
|
102
|
+
- port: 5432
|
|
103
|
+
---
|
|
104
|
+
# Gitea
|
|
105
|
+
apiVersion: apps/v1
|
|
106
|
+
kind: Deployment
|
|
107
|
+
metadata:
|
|
108
|
+
name: gitea
|
|
109
|
+
namespace: tribe-system
|
|
110
|
+
spec:
|
|
111
|
+
replicas: 1
|
|
112
|
+
selector:
|
|
113
|
+
matchLabels:
|
|
114
|
+
app: gitea
|
|
115
|
+
template:
|
|
116
|
+
metadata:
|
|
117
|
+
labels:
|
|
118
|
+
app: gitea
|
|
119
|
+
spec:
|
|
120
|
+
initContainers:
|
|
121
|
+
- name: wait-for-db
|
|
122
|
+
image: busybox:1.35
|
|
123
|
+
command: ['sh', '-c', 'until nc -z postgres 5432; do echo waiting for db; sleep 2; done']
|
|
124
|
+
- name: init-gitea
|
|
125
|
+
image: gitea/gitea:1.20.5
|
|
126
|
+
command: ['/bin/bash', '-c']
|
|
127
|
+
args:
|
|
128
|
+
- |
|
|
129
|
+
# Create app.ini
|
|
130
|
+
mkdir -p /data/gitea/conf
|
|
131
|
+
cat > /data/gitea/conf/app.ini << 'EOF'
|
|
132
|
+
APP_NAME = Gitea
|
|
133
|
+
RUN_MODE = prod
|
|
134
|
+
|
|
135
|
+
[database]
|
|
136
|
+
DB_TYPE = postgres
|
|
137
|
+
HOST = postgres:5432
|
|
138
|
+
NAME = gitea
|
|
139
|
+
USER = gitea
|
|
140
|
+
PASSWD = gitea
|
|
141
|
+
|
|
142
|
+
[server]
|
|
143
|
+
DOMAIN = gitea
|
|
144
|
+
ROOT_URL = http://gitea:3000/
|
|
145
|
+
HTTP_PORT = 3000
|
|
146
|
+
|
|
147
|
+
[service]
|
|
148
|
+
DISABLE_REGISTRATION = true
|
|
149
|
+
|
|
150
|
+
[security]
|
|
151
|
+
INSTALL_LOCK = true
|
|
152
|
+
SECRET_KEY = changeme
|
|
153
|
+
EOF
|
|
154
|
+
|
|
155
|
+
# Run migrations
|
|
156
|
+
gitea migrate
|
|
157
|
+
|
|
158
|
+
# Create admin user
|
|
159
|
+
gitea admin user create --admin --username gitea_admin --password admin123 --email admin@example.com || true
|
|
160
|
+
env:
|
|
161
|
+
- name: GITEA_WORK_DIR
|
|
162
|
+
value: /data
|
|
163
|
+
- name: GITEA_CUSTOM
|
|
164
|
+
value: /data/gitea
|
|
165
|
+
volumeMounts:
|
|
166
|
+
- name: gitea-data
|
|
167
|
+
mountPath: /data
|
|
168
|
+
containers:
|
|
169
|
+
- name: gitea
|
|
170
|
+
image: gitea/gitea:1.20.5
|
|
171
|
+
ports:
|
|
172
|
+
- containerPort: 3000
|
|
173
|
+
env:
|
|
174
|
+
- name: GITEA_WORK_DIR
|
|
175
|
+
value: /data
|
|
176
|
+
- name: GITEA_CUSTOM
|
|
177
|
+
value: /data/gitea
|
|
178
|
+
volumeMounts:
|
|
179
|
+
- name: gitea-data
|
|
180
|
+
mountPath: /data
|
|
181
|
+
readinessProbe:
|
|
182
|
+
httpGet:
|
|
183
|
+
path: /
|
|
184
|
+
port: 3000
|
|
185
|
+
initialDelaySeconds: 30
|
|
186
|
+
periodSeconds: 10
|
|
187
|
+
volumes:
|
|
188
|
+
- name: gitea-data
|
|
189
|
+
emptyDir: {}
|
|
190
|
+
---
|
|
191
|
+
apiVersion: v1
|
|
192
|
+
kind: Service
|
|
193
|
+
metadata:
|
|
194
|
+
name: gitea
|
|
195
|
+
namespace: tribe-system
|
|
196
|
+
spec:
|
|
197
|
+
selector:
|
|
198
|
+
app: gitea
|
|
199
|
+
ports:
|
|
200
|
+
- port: 3000
|
|
201
|
+
---
|
|
202
|
+
# TaskMaster
|
|
203
|
+
apiVersion: apps/v1
|
|
204
|
+
kind: Deployment
|
|
205
|
+
metadata:
|
|
206
|
+
name: taskmaster
|
|
207
|
+
namespace: tribe-system
|
|
208
|
+
spec:
|
|
209
|
+
replicas: 1
|
|
210
|
+
selector:
|
|
211
|
+
matchLabels:
|
|
212
|
+
app: taskmaster
|
|
213
|
+
template:
|
|
214
|
+
metadata:
|
|
215
|
+
labels:
|
|
216
|
+
app: taskmaster
|
|
217
|
+
spec:
|
|
218
|
+
initContainers:
|
|
219
|
+
- name: wait-for-db
|
|
220
|
+
image: busybox:1.35
|
|
221
|
+
command: ['sh', '-c', 'until nc -z postgres 5432; do echo waiting for db; sleep 2; done']
|
|
222
|
+
containers:
|
|
223
|
+
- name: taskmaster
|
|
224
|
+
image: tribexal/tribe:latest-taskmaster
|
|
225
|
+
imagePullPolicy: IfNotPresent
|
|
226
|
+
ports:
|
|
227
|
+
- containerPort: 8080
|
|
228
|
+
env:
|
|
229
|
+
- name: FLASK_ENV
|
|
230
|
+
value: development
|
|
231
|
+
- name: DATABASE_URL
|
|
232
|
+
value: postgresql://gitea:gitea@postgres:5432/gitea
|
|
233
|
+
- name: GITEA_URL
|
|
234
|
+
value: http://gitea:3000
|
|
235
|
+
- name: GITEA_TOKEN
|
|
236
|
+
value: will-be-set-by-init-job
|
|
237
|
+
readinessProbe:
|
|
238
|
+
httpGet:
|
|
239
|
+
path: /health
|
|
240
|
+
port: 8080
|
|
241
|
+
initialDelaySeconds: 10
|
|
242
|
+
periodSeconds: 5
|
|
243
|
+
---
|
|
244
|
+
apiVersion: v1
|
|
245
|
+
kind: Service
|
|
246
|
+
metadata:
|
|
247
|
+
name: taskmaster
|
|
248
|
+
namespace: tribe-system
|
|
249
|
+
spec:
|
|
250
|
+
selector:
|
|
251
|
+
app: taskmaster
|
|
252
|
+
ports:
|
|
253
|
+
- port: 5000
|
|
254
|
+
targetPort: 8080
|
|
255
|
+
---
|
|
256
|
+
# Bridge
|
|
257
|
+
apiVersion: apps/v1
|
|
258
|
+
kind: Deployment
|
|
259
|
+
metadata:
|
|
260
|
+
name: bridge
|
|
261
|
+
namespace: tribe-system
|
|
262
|
+
spec:
|
|
263
|
+
replicas: 1
|
|
264
|
+
selector:
|
|
265
|
+
matchLabels:
|
|
266
|
+
app: bridge
|
|
267
|
+
template:
|
|
268
|
+
metadata:
|
|
269
|
+
labels:
|
|
270
|
+
app: bridge
|
|
271
|
+
spec:
|
|
272
|
+
serviceAccountName: bridge
|
|
273
|
+
initContainers:
|
|
274
|
+
- name: wait-for-services
|
|
275
|
+
image: busybox:1.35
|
|
276
|
+
command: ['sh', '-c']
|
|
277
|
+
args:
|
|
278
|
+
- |
|
|
279
|
+
echo "Waiting for services..."
|
|
280
|
+
until nc -z taskmaster 5000; do echo waiting for taskmaster; sleep 2; done
|
|
281
|
+
until nc -z gitea 3000; do echo waiting for gitea; sleep 2; done
|
|
282
|
+
echo "All services ready!"
|
|
283
|
+
containers:
|
|
284
|
+
- name: bridge
|
|
285
|
+
image: tribexal/tribe:latest-bridge
|
|
286
|
+
imagePullPolicy: IfNotPresent
|
|
287
|
+
ports:
|
|
288
|
+
- containerPort: 8080
|
|
289
|
+
- containerPort: 3456
|
|
290
|
+
env:
|
|
291
|
+
- name: TASKMASTER_URL
|
|
292
|
+
value: http://taskmaster:5000
|
|
293
|
+
- name: GITEA_URL
|
|
294
|
+
value: http://gitea:3000
|
|
295
|
+
- name: GITEA_ADMIN_USER
|
|
296
|
+
value: gitea_admin
|
|
297
|
+
- name: GITEA_ADMIN_PASSWORD
|
|
298
|
+
value: admin123
|
|
299
|
+
- name: NAMESPACE
|
|
300
|
+
value: tribe-system
|
|
301
|
+
readinessProbe:
|
|
302
|
+
httpGet:
|
|
303
|
+
path: /health
|
|
304
|
+
port: 8080
|
|
305
|
+
initialDelaySeconds: 10
|
|
306
|
+
periodSeconds: 5
|
|
307
|
+
---
|
|
308
|
+
apiVersion: v1
|
|
309
|
+
kind: Service
|
|
310
|
+
metadata:
|
|
311
|
+
name: bridge
|
|
312
|
+
namespace: tribe-system
|
|
313
|
+
spec:
|
|
314
|
+
selector:
|
|
315
|
+
app: bridge
|
|
316
|
+
ports:
|
|
317
|
+
- name: http
|
|
318
|
+
port: 8080
|
|
319
|
+
- name: websocket
|
|
320
|
+
port: 3456
|
|
321
|
+
---
|
|
322
|
+
# Claude Worker Deployment (starts with 0 replicas)
|
|
323
|
+
apiVersion: apps/v1
|
|
324
|
+
kind: Deployment
|
|
325
|
+
metadata:
|
|
326
|
+
name: claude-worker-deployment
|
|
327
|
+
namespace: tribe-system
|
|
328
|
+
spec:
|
|
329
|
+
replicas: 0
|
|
330
|
+
selector:
|
|
331
|
+
matchLabels:
|
|
332
|
+
app: claude-worker
|
|
333
|
+
template:
|
|
334
|
+
metadata:
|
|
335
|
+
labels:
|
|
336
|
+
app: claude-worker
|
|
337
|
+
spec:
|
|
338
|
+
containers:
|
|
339
|
+
- name: claude-agent
|
|
340
|
+
image: tribexal/tribe:latest-claude-agent
|
|
341
|
+
imagePullPolicy: IfNotPresent
|
|
342
|
+
env:
|
|
343
|
+
- name: ROLE
|
|
344
|
+
value: worker
|
|
345
|
+
- name: TASKMASTER_URL
|
|
346
|
+
value: http://taskmaster:5000
|
|
347
|
+
- name: GITEA_URL
|
|
348
|
+
value: http://gitea:3000
|
|
349
|
+
- name: NAMESPACE
|
|
350
|
+
value: tribe-system
|
|
351
|
+
- name: ANTHROPIC_API_KEY
|
|
352
|
+
valueFrom:
|
|
353
|
+
secretKeyRef:
|
|
354
|
+
name: claude-api-key
|
|
355
|
+
key: api-key
|
|
356
|
+
optional: true
|
|
357
|
+
volumeMounts:
|
|
358
|
+
- name: workspace
|
|
359
|
+
mountPath: /workspace
|
|
360
|
+
- name: config
|
|
361
|
+
mountPath: /app/minimal-config
|
|
362
|
+
readinessProbe:
|
|
363
|
+
exec:
|
|
364
|
+
command:
|
|
365
|
+
- /bin/sh
|
|
366
|
+
- -c
|
|
367
|
+
- test -f /tmp/worker-ready
|
|
368
|
+
initialDelaySeconds: 30
|
|
369
|
+
periodSeconds: 10
|
|
370
|
+
volumes:
|
|
371
|
+
- name: workspace
|
|
372
|
+
emptyDir: {}
|
|
373
|
+
- name: config
|
|
374
|
+
configMap:
|
|
375
|
+
name: claude-config
|
|
376
|
+
optional: true
|
|
377
|
+
---
|
|
378
|
+
# NodePort service for easy access
|
|
379
|
+
apiVersion: v1
|
|
380
|
+
kind: Service
|
|
381
|
+
metadata:
|
|
382
|
+
name: bridge-nodeport
|
|
383
|
+
namespace: tribe-system
|
|
384
|
+
spec:
|
|
385
|
+
type: NodePort
|
|
386
|
+
selector:
|
|
387
|
+
app: bridge
|
|
388
|
+
ports:
|
|
389
|
+
- name: http
|
|
390
|
+
port: 8080
|
|
391
|
+
nodePort: 30080
|
|
392
|
+
- name: websocket
|
|
393
|
+
port: 3456
|
|
394
|
+
nodePort: 30456
|
|
395
|
+
---
|
|
396
|
+
# ConfigMap for Claude agent configuration
|
|
397
|
+
apiVersion: v1
|
|
398
|
+
kind: ConfigMap
|
|
399
|
+
metadata:
|
|
400
|
+
name: claude-config
|
|
401
|
+
namespace: tribe-system
|
|
402
|
+
data:
|
|
403
|
+
config.yaml: |
|
|
404
|
+
mcp_servers:
|
|
405
|
+
filesystem:
|
|
406
|
+
command: npx
|
|
407
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
|
|
408
|
+
git:
|
|
409
|
+
command: npx
|
|
410
|
+
args: ["-y", "@modelcontextprotocol/server-git"]
|
|
411
|
+
env:
|
|
412
|
+
PATH: /usr/local/bin:/usr/bin:/bin
|
|
413
|
+
---
|
|
414
|
+
# Initialization Job
|
|
415
|
+
apiVersion: batch/v1
|
|
416
|
+
kind: Job
|
|
417
|
+
metadata:
|
|
418
|
+
name: tribe-init
|
|
419
|
+
namespace: tribe-system
|
|
420
|
+
spec:
|
|
421
|
+
template:
|
|
422
|
+
spec:
|
|
423
|
+
restartPolicy: OnFailure
|
|
424
|
+
containers:
|
|
425
|
+
- name: init
|
|
426
|
+
image: curlimages/curl:8.4.0
|
|
427
|
+
command: ['/bin/sh', '-c']
|
|
428
|
+
args:
|
|
429
|
+
- |
|
|
430
|
+
echo "Waiting for Gitea to be ready..."
|
|
431
|
+
until curl -s http://gitea:3000 > /dev/null; do
|
|
432
|
+
echo "Waiting for Gitea..."
|
|
433
|
+
sleep 5
|
|
434
|
+
done
|
|
435
|
+
|
|
436
|
+
echo "Creating Gitea access token..."
|
|
437
|
+
TOKEN=$(curl -s -X POST http://gitea:3000/api/v1/users/gitea_admin/tokens \
|
|
438
|
+
-u gitea_admin:admin123 \
|
|
439
|
+
-H "Content-Type: application/json" \
|
|
440
|
+
-d '{"name":"taskmaster-'$(date +%s)'","scopes":["write:repository","write:user","write:issue","write:organization","read:repository"]}' \
|
|
441
|
+
| grep -o '"sha1":"[^"]*' | cut -d'"' -f4)
|
|
442
|
+
|
|
443
|
+
if [ -z "$TOKEN" ]; then
|
|
444
|
+
echo "Failed to create token!"
|
|
445
|
+
exit 1
|
|
446
|
+
fi
|
|
447
|
+
|
|
448
|
+
echo "Token created successfully"
|
|
449
|
+
|
|
450
|
+
# Update TaskMaster with the token
|
|
451
|
+
echo "Updating TaskMaster configuration..."
|
|
452
|
+
curl -X POST http://taskmaster:5000/api/config \
|
|
453
|
+
-H "Content-Type: application/json" \
|
|
454
|
+
-d "{\"gitea_token\":\"$TOKEN\"}"
|
|
455
|
+
|
|
456
|
+
echo "Initialization complete!"
|