@kithinji/pod 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/README.md +439 -0
- package/dist/main.js +109 -2
- package/dist/main.js.map +2 -2
- package/dist/types/docker/docker.d.ts.map +1 -1
- package/package.json +31 -8
- package/build.js +0 -22
- package/src/add/component/component.ts +0 -496
- package/src/add/component/index.ts +0 -1
- package/src/add/index.ts +0 -3
- package/src/add/module/index.ts +0 -1
- package/src/add/module/module.ts +0 -545
- package/src/add/new/index.ts +0 -198
- package/src/config/config.ts +0 -141
- package/src/config/index.ts +0 -1
- package/src/deploy/deploy.ts +0 -592
- package/src/deploy/index.ts +0 -1
- package/src/dev/index.ts +0 -1
- package/src/dev/project.ts +0 -45
- package/src/dev/server.ts +0 -191
- package/src/docker/docker.ts +0 -592
- package/src/docker/index.ts +0 -1
- package/src/macros/expand_macros.ts +0 -791
- package/src/macros/index.ts +0 -2
- package/src/macros/macro_executer.ts +0 -189
- package/src/main.ts +0 -106
- package/src/plugins/analyzers/graph.ts +0 -279
- package/src/plugins/css/index.ts +0 -25
- package/src/plugins/generators/generate_controller.ts +0 -308
- package/src/plugins/generators/generate_rsc.ts +0 -274
- package/src/plugins/generators/generate_server_component.ts +0 -455
- package/src/plugins/generators/tsx_server_stub.ts +0 -315
- package/src/plugins/index.ts +0 -3
- package/src/plugins/my.ts +0 -282
- package/src/plugins/transformers/j2d.ts +0 -1080
- package/src/store/index.ts +0 -1
- package/src/store/store.ts +0 -44
- package/src/utils/cases.ts +0 -15
- package/src/utils/create.ts +0 -26
- package/src/utils/index.ts +0 -2
- package/tsconfig.json +0 -27
package/README.md
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
<h1 align="center">Pod</h1>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://i.postimg.cc/Wpq8CWvV/orca.png" alt="pod-logo" width="150px"/>
|
|
4
|
+
<br>
|
|
5
|
+
<em>The CLI tool for Orca that handles everything from scaffolding to deployment.</em>
|
|
6
|
+
<br>
|
|
7
|
+
</p>
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://orca.dafifi.net/"><strong>orca.dafifi.net</strong></a>
|
|
10
|
+
<br>
|
|
11
|
+
</p>
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/@kithinji/pod">
|
|
14
|
+
<img src="https://img.shields.io/badge/NPM_package-v1.0.21-blue" alt="Pod on npm" />
|
|
15
|
+
</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<hr>
|
|
19
|
+
|
|
20
|
+
## What is Pod?
|
|
21
|
+
|
|
22
|
+
Pod is the official CLI tool for Orca. It's your command center for creating, developing, and deploying Orca applications.
|
|
23
|
+
|
|
24
|
+
Unlike most framework CLIs that stop at scaffolding, Pod follows you through the entire development lifecycle:
|
|
25
|
+
|
|
26
|
+
- **Create** new Orca projects with best-practice structure
|
|
27
|
+
- **Generate** components, services, and modules instantly
|
|
28
|
+
- **Develop** with a fast, integrated development server
|
|
29
|
+
- **Dockerize** your application with zero configuration
|
|
30
|
+
- **Deploy** to cloud platforms like AWS EC2 with built-in automation
|
|
31
|
+
|
|
32
|
+
Pod is designed with one philosophy: **never abandon the developer**. From `pod new` to production deployment, Pod is there every step of the way.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
Install Pod globally via npm:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g @kithinji/pod
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Verify installation:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pod --version
|
|
46
|
+
# Output: 1.0.21
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
### `pod new <name>`
|
|
52
|
+
|
|
53
|
+
Create a new Orca project with a complete starter template.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pod new my-app
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**What it does:**
|
|
60
|
+
|
|
61
|
+
1. Scaffolds a complete Orca project structure
|
|
62
|
+
2. Installs all dependencies automatically
|
|
63
|
+
3. Starts the development server immediately
|
|
64
|
+
|
|
65
|
+
**Output structure:**
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
my-app/
|
|
69
|
+
├── src/
|
|
70
|
+
│ │ └── app/
|
|
71
|
+
│ │ ├── app.module.ts
|
|
72
|
+
│ │ ├── app.service.ts
|
|
73
|
+
│ │ └── app.page.tsx
|
|
74
|
+
│ └── main.ts
|
|
75
|
+
├── package.json
|
|
76
|
+
├── tsconfig.json
|
|
77
|
+
└── pod.config.tx
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
After running this command, your app is live at `http://localhost:8080` and ready for development.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### `pod dev`
|
|
85
|
+
|
|
86
|
+
Start the Orca development server with hot reload.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pod dev
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Features:**
|
|
93
|
+
|
|
94
|
+
- Hot module replacement for instant feedback
|
|
95
|
+
- Automatic TypeScript compilation
|
|
96
|
+
- Watches for file changes across the entire project
|
|
97
|
+
- Compiles separate client and server bundles
|
|
98
|
+
- Serves the application locally
|
|
99
|
+
|
|
100
|
+
**Development workflow:**
|
|
101
|
+
|
|
102
|
+
1. Make changes to any file (components, services, modules)
|
|
103
|
+
2. Pod detects the change and recompiles
|
|
104
|
+
3. Browser automatically refreshes with your changes
|
|
105
|
+
4. Check the terminal for any compilation errors
|
|
106
|
+
|
|
107
|
+
Run this command from your project root whenever you're ready to develop.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### `pod add <type> <name>`
|
|
112
|
+
|
|
113
|
+
Generate new code scaffolding instantly.
|
|
114
|
+
|
|
115
|
+
**Add a component:**
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pod add c button
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Creates `button.component.tsx`. This is inspired by `Shadcn/ui` where you components live inside your code instead of being hidden behind libraries.
|
|
122
|
+
|
|
123
|
+
**Add a feature module:**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pod add f user
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Creates a complete feature module with:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
src/features/user/
|
|
133
|
+
├── user.module.ts # Module definition
|
|
134
|
+
├── user.service.ts # Business logic service
|
|
135
|
+
└── user.page.tsx # UI page component
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Generated files include:**
|
|
139
|
+
|
|
140
|
+
- Proper imports and decorators
|
|
141
|
+
- Dependency injection setup
|
|
142
|
+
- Module exports configuration
|
|
143
|
+
- Component/service boilerplate
|
|
144
|
+
|
|
145
|
+
**Types:**
|
|
146
|
+
|
|
147
|
+
- `c` - Component: Creates a single component file
|
|
148
|
+
- `f` - Feature: Creates a complete module with service and component
|
|
149
|
+
|
|
150
|
+
This command saves you from writing repetitive boilerplate and ensures consistency across your codebase.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### `pod dockerize <env>`
|
|
155
|
+
|
|
156
|
+
Generate Docker configuration for your Orca application.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pod dockerize production
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**What it generates:**
|
|
163
|
+
|
|
164
|
+
1. `Dockerfile` - Optimized multi-stage build configuration
|
|
165
|
+
2. `.dockerignore` - Excludes unnecessary files from the image
|
|
166
|
+
3. `docker-compose.yml` - Will read package.json to determine which services to generate.
|
|
167
|
+
|
|
168
|
+
**The generated Dockerfile:**
|
|
169
|
+
|
|
170
|
+
- Uses multi-stage builds for smaller images
|
|
171
|
+
- Installs only production dependencies
|
|
172
|
+
- Optimizes layer caching for faster builds
|
|
173
|
+
- Sets up proper Node.js environment
|
|
174
|
+
- Configures the application to run in production mode
|
|
175
|
+
|
|
176
|
+
**After generation:**
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Run the container
|
|
180
|
+
docker compose up --build
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Environment-specific configs:**
|
|
184
|
+
|
|
185
|
+
The `<env>` parameter can be used to generate environment-specific Docker configurations (e.g., `development`, `production`). Pod will adjust settings like:
|
|
186
|
+
|
|
187
|
+
- Environment variables
|
|
188
|
+
- Build optimization levels
|
|
189
|
+
- Included dev dependencies
|
|
190
|
+
- Exposed ports
|
|
191
|
+
- Tunnel database connections through ssh if in development
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
### `pod deploy <target> [options]`
|
|
196
|
+
|
|
197
|
+
Deploy your Orca application to cloud platforms.
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
pod deploy ec2
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Supported targets:**
|
|
204
|
+
|
|
205
|
+
- `ec2` - AWS EC2 instances
|
|
206
|
+
- More platforms coming soon (Heroku, DigitalOcean, etc.)
|
|
207
|
+
|
|
208
|
+
**What it does:**
|
|
209
|
+
|
|
210
|
+
1. Reads deployment configuration from `pod.deploy.yml`
|
|
211
|
+
2. Builds your application for production
|
|
212
|
+
3. Creates necessary cloud resources (if needed)
|
|
213
|
+
4. Uploads your application to the target
|
|
214
|
+
5. Starts the application
|
|
215
|
+
|
|
216
|
+
**Options:**
|
|
217
|
+
|
|
218
|
+
`--force-install` - Force reinstallation of dependencies even if already present on the target
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
pod deploy ec2 --force-install
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Configuration file (`pod.deploy.yml`):**
|
|
225
|
+
|
|
226
|
+
```yml
|
|
227
|
+
name: my-app
|
|
228
|
+
version: 1.0.0
|
|
229
|
+
|
|
230
|
+
targets:
|
|
231
|
+
ec2:
|
|
232
|
+
host: ec2-xx-xx-xxx-xxx.xx-xxxx-x.compute.amazonaws.com
|
|
233
|
+
user: ubuntu
|
|
234
|
+
keyPath: ~/xxxx.pem
|
|
235
|
+
port: 22
|
|
236
|
+
deployPath: /home/\${user}/app
|
|
237
|
+
|
|
238
|
+
operations:
|
|
239
|
+
- name: "Setup swap space"
|
|
240
|
+
type: ensure
|
|
241
|
+
ensure:
|
|
242
|
+
swap:
|
|
243
|
+
size: 4G
|
|
244
|
+
|
|
245
|
+
- name: "Install Docker"
|
|
246
|
+
type: ensure
|
|
247
|
+
ensure:
|
|
248
|
+
docker:
|
|
249
|
+
version: "28.5.2"
|
|
250
|
+
addUserToGroup: true
|
|
251
|
+
|
|
252
|
+
- name: "Create application directories"
|
|
253
|
+
type: ensure
|
|
254
|
+
ensure:
|
|
255
|
+
directory:
|
|
256
|
+
path: \${deployPath}
|
|
257
|
+
owner: \${user}
|
|
258
|
+
|
|
259
|
+
- name: "Create backup directory"
|
|
260
|
+
type: ensure
|
|
261
|
+
ensure:
|
|
262
|
+
directory:
|
|
263
|
+
path: /home/\${user}/backups
|
|
264
|
+
owner: \${user}
|
|
265
|
+
|
|
266
|
+
- name: "Stop running containers"
|
|
267
|
+
type: action
|
|
268
|
+
action:
|
|
269
|
+
command: cd \${deployPath} && docker compose down 2>/dev/null || true
|
|
270
|
+
|
|
271
|
+
- name: "Sync application files"
|
|
272
|
+
type: action
|
|
273
|
+
action:
|
|
274
|
+
rsync:
|
|
275
|
+
source: ./
|
|
276
|
+
destination: \${deployPath}/
|
|
277
|
+
exclude:
|
|
278
|
+
- node_modules/
|
|
279
|
+
- .git/
|
|
280
|
+
- "*.log"
|
|
281
|
+
- .env.local
|
|
282
|
+
- dist/
|
|
283
|
+
- public/
|
|
284
|
+
|
|
285
|
+
- name: "Pull Docker images"
|
|
286
|
+
type: action
|
|
287
|
+
action:
|
|
288
|
+
command: cd \${deployPath} && docker compose pull
|
|
289
|
+
|
|
290
|
+
- name: "Build and start containers"
|
|
291
|
+
type: action
|
|
292
|
+
action:
|
|
293
|
+
command: cd \${deployPath} && docker compose up -d --build --remove-orphans
|
|
294
|
+
|
|
295
|
+
- name: "Wait for services to start"
|
|
296
|
+
type: action
|
|
297
|
+
action:
|
|
298
|
+
command: sleep 10
|
|
299
|
+
|
|
300
|
+
- name: "Show container status"
|
|
301
|
+
type: action
|
|
302
|
+
action:
|
|
303
|
+
command: cd \${deployPath} && docker compose ps
|
|
304
|
+
|
|
305
|
+
- name: "Show recent logs"
|
|
306
|
+
type: action
|
|
307
|
+
action:
|
|
308
|
+
command: cd \${deployPath} && docker compose logs --tail=30
|
|
309
|
+
|
|
310
|
+
- name: "Cleanup old backups"
|
|
311
|
+
type: action
|
|
312
|
+
action:
|
|
313
|
+
command: find /home/\${user}/backups -name "backup-*.tar.gz" -mtime +7 -delete
|
|
314
|
+
|
|
315
|
+
- name: "Cleanup Docker resources"
|
|
316
|
+
type: action
|
|
317
|
+
action:
|
|
318
|
+
command: docker system prune -f --volumes
|
|
319
|
+
|
|
320
|
+
- name: "Verify containers are running"
|
|
321
|
+
type: verify
|
|
322
|
+
verify:
|
|
323
|
+
command: cd \${deployPath} && docker compose ps | grep -q "Up"
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**First-time setup:**
|
|
327
|
+
|
|
328
|
+
Pod will guide you through setting up deployment credentials and configuration the first time you run `pod deploy`. It will:
|
|
329
|
+
|
|
330
|
+
- Prompt for necessary credentials (AWS keys, etc.)
|
|
331
|
+
- Validate your configuration
|
|
332
|
+
- Save settings to `pod.deploy.yml`
|
|
333
|
+
- Optionally create required cloud resources
|
|
334
|
+
|
|
335
|
+
**Deployment workflow:**
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
pod deploy ec2
|
|
339
|
+
|
|
340
|
+
# Pod handles the rest:
|
|
341
|
+
# ✓ Building production bundle
|
|
342
|
+
# ✓ Uploading to EC2
|
|
343
|
+
# ✓ Installing dependencies
|
|
344
|
+
# ✓ Starting the server
|
|
345
|
+
# ✓ Configuring environment
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Workflow Example
|
|
351
|
+
|
|
352
|
+
Here's a complete workflow from project creation to deployment:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# 1. Create a new Orca app
|
|
356
|
+
pod new my-app
|
|
357
|
+
# (Pod automatically installs deps and starts dev server)
|
|
358
|
+
|
|
359
|
+
# 2. Add a new feature
|
|
360
|
+
pod add f product
|
|
361
|
+
|
|
362
|
+
# 3. Develop your app
|
|
363
|
+
# (Make changes, Pod hot-reloads automatically)
|
|
364
|
+
|
|
365
|
+
# 4. When ready to deploy, dockerize it
|
|
366
|
+
pod dockerize prod
|
|
367
|
+
|
|
368
|
+
# 5. Deploy to EC2
|
|
369
|
+
pod deploy ec2
|
|
370
|
+
|
|
371
|
+
# Done! Your app is live.
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
## Why Pod?
|
|
375
|
+
|
|
376
|
+
Most framework CLIs give you `create-app` and then disappear. Pod stays with you through the entire lifecycle:
|
|
377
|
+
|
|
378
|
+
**From idea to production:**
|
|
379
|
+
|
|
380
|
+
- `pod new` - Start building
|
|
381
|
+
- `pod add` - Generate code as you grow
|
|
382
|
+
- `pod dev` - Develop with instant feedback
|
|
383
|
+
- `pod dockerize` - Containerize for deployment
|
|
384
|
+
- `pod deploy` - Ship to production
|
|
385
|
+
|
|
386
|
+
**One tool. End to end. No gaps.**
|
|
387
|
+
|
|
388
|
+
That's the Pod philosophy.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Comparison with Other CLIs
|
|
393
|
+
|
|
394
|
+
| Feature | Pod | Create-React-App | Angular CLI | Next.js CLI |
|
|
395
|
+
|---------|-----|------------------|-------------|-------------|
|
|
396
|
+
| Project scaffolding | ✅ | ✅ | ✅ | ✅ |
|
|
397
|
+
| Component generation | ✅ | ❌ | ✅ | ❌ |
|
|
398
|
+
| Service generation | ✅ | ❌ | ✅ | ❌ |
|
|
399
|
+
| Module generation | ✅ | ❌ | ✅ | ❌ |
|
|
400
|
+
| Dev server | ✅ | ✅ | ✅ | ✅ |
|
|
401
|
+
| Built-in Docker support | ✅ | ❌ | ❌ | ❌ |
|
|
402
|
+
| One-command deployment | ✅ | ❌ | ❌ | ❌ |
|
|
403
|
+
| Full-stack architecture | ✅ | ❌ | ❌ | Partial |
|
|
404
|
+
|
|
405
|
+
Pod doesn't just scaffold; it's your development companion from first line to first user.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Contributing
|
|
410
|
+
|
|
411
|
+
Pod is open source and welcomes contributions. Areas where we need help:
|
|
412
|
+
|
|
413
|
+
- Additional deployment targets (Heroku, DigitalOcean, Azure, etc.)
|
|
414
|
+
- Template customization
|
|
415
|
+
- Plugin development
|
|
416
|
+
- Documentation improvements
|
|
417
|
+
|
|
418
|
+
Check out the [contribution guidelines](https://github.com/kithinji/pod/CONTRIBUTING.md) to get started.
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## Stay in Touch
|
|
423
|
+
|
|
424
|
+
- **Author**: [Kithinji Brian](https://www.linkedin.com/in/kithinjibrian/)
|
|
425
|
+
- **Website**: [orca.dafifi.net](https://orca.dafifi.net/)
|
|
426
|
+
- **NPM**: [@kithinji/pod](https://www.npmjs.com/package/@kithinji/pod)
|
|
427
|
+
- **GitHub**: [github.com/kithinji/pod](https://github.com/kithinji/pod)
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## License
|
|
432
|
+
|
|
433
|
+
MIT
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
<p align="center">
|
|
438
|
+
<strong>Pod: The CLI that never abandons you.</strong>
|
|
439
|
+
</p>
|
package/dist/main.js
CHANGED
|
@@ -4361,6 +4361,7 @@ async function dockerize(env = "prod") {
|
|
|
4361
4361
|
} else {
|
|
4362
4362
|
await setupDevelopment(cwd, projectName, selectedServices);
|
|
4363
4363
|
}
|
|
4364
|
+
await createDeployfile(cwd, projectName);
|
|
4364
4365
|
await writeEnvVars(cwd, selectedServices, env);
|
|
4365
4366
|
printNextSteps(projectName, env, selectedServices);
|
|
4366
4367
|
}
|
|
@@ -4541,6 +4542,108 @@ temp
|
|
|
4541
4542
|
await fs9.writeFile(dockerfilePath, dockerfile);
|
|
4542
4543
|
await fs9.writeFile(dockerignorePath, dockerignore);
|
|
4543
4544
|
}
|
|
4545
|
+
async function createDeployfile(cwd, projectName) {
|
|
4546
|
+
const deployFile = `name: ${projectName}
|
|
4547
|
+
version: 1.0.0
|
|
4548
|
+
|
|
4549
|
+
targets:
|
|
4550
|
+
ec2:
|
|
4551
|
+
host: ec2-xx-xx-xxx-xxx.xx-xxxx-x.compute.amazonaws.com
|
|
4552
|
+
user: ubuntu
|
|
4553
|
+
keyPath: ~/xxxx.pem
|
|
4554
|
+
port: 22
|
|
4555
|
+
deployPath: /home/\${user}/app
|
|
4556
|
+
|
|
4557
|
+
operations:
|
|
4558
|
+
- name: "Setup swap space"
|
|
4559
|
+
type: ensure
|
|
4560
|
+
ensure:
|
|
4561
|
+
swap:
|
|
4562
|
+
size: 4G
|
|
4563
|
+
|
|
4564
|
+
- name: "Install Docker"
|
|
4565
|
+
type: ensure
|
|
4566
|
+
ensure:
|
|
4567
|
+
docker:
|
|
4568
|
+
version: "28.5.2"
|
|
4569
|
+
addUserToGroup: true
|
|
4570
|
+
|
|
4571
|
+
- name: "Create application directories"
|
|
4572
|
+
type: ensure
|
|
4573
|
+
ensure:
|
|
4574
|
+
directory:
|
|
4575
|
+
path: \${deployPath}
|
|
4576
|
+
owner: \${user}
|
|
4577
|
+
|
|
4578
|
+
- name: "Create backup directory"
|
|
4579
|
+
type: ensure
|
|
4580
|
+
ensure:
|
|
4581
|
+
directory:
|
|
4582
|
+
path: /home/\${user}/backups
|
|
4583
|
+
owner: \${user}
|
|
4584
|
+
|
|
4585
|
+
- name: "Stop running containers"
|
|
4586
|
+
type: action
|
|
4587
|
+
action:
|
|
4588
|
+
command: cd \${deployPath} && docker compose down 2>/dev/null || true
|
|
4589
|
+
|
|
4590
|
+
- name: "Sync application files"
|
|
4591
|
+
type: action
|
|
4592
|
+
action:
|
|
4593
|
+
rsync:
|
|
4594
|
+
source: ./
|
|
4595
|
+
destination: \${deployPath}/
|
|
4596
|
+
exclude:
|
|
4597
|
+
- node_modules/
|
|
4598
|
+
- .git/
|
|
4599
|
+
- "*.log"
|
|
4600
|
+
- .env.local
|
|
4601
|
+
- dist/
|
|
4602
|
+
- public/
|
|
4603
|
+
|
|
4604
|
+
- name: "Pull Docker images"
|
|
4605
|
+
type: action
|
|
4606
|
+
action:
|
|
4607
|
+
command: cd \${deployPath} && docker compose pull
|
|
4608
|
+
|
|
4609
|
+
- name: "Build and start containers"
|
|
4610
|
+
type: action
|
|
4611
|
+
action:
|
|
4612
|
+
command: cd \${deployPath} && docker compose up -d --build --remove-orphans
|
|
4613
|
+
|
|
4614
|
+
- name: "Wait for services to start"
|
|
4615
|
+
type: action
|
|
4616
|
+
action:
|
|
4617
|
+
command: sleep 10
|
|
4618
|
+
|
|
4619
|
+
- name: "Show container status"
|
|
4620
|
+
type: action
|
|
4621
|
+
action:
|
|
4622
|
+
command: cd \${deployPath} && docker compose ps
|
|
4623
|
+
|
|
4624
|
+
- name: "Show recent logs"
|
|
4625
|
+
type: action
|
|
4626
|
+
action:
|
|
4627
|
+
command: cd \${deployPath} && docker compose logs --tail=30
|
|
4628
|
+
|
|
4629
|
+
- name: "Cleanup old backups"
|
|
4630
|
+
type: action
|
|
4631
|
+
action:
|
|
4632
|
+
command: find /home/\${user}/backups -name "backup-*.tar.gz" -mtime +7 -delete
|
|
4633
|
+
|
|
4634
|
+
- name: "Cleanup Docker resources"
|
|
4635
|
+
type: action
|
|
4636
|
+
action:
|
|
4637
|
+
command: docker system prune -f --volumes
|
|
4638
|
+
|
|
4639
|
+
- name: "Verify containers are running"
|
|
4640
|
+
type: verify
|
|
4641
|
+
verify:
|
|
4642
|
+
command: cd \${deployPath} && docker compose ps | grep -q "Up"
|
|
4643
|
+
`;
|
|
4644
|
+
const deployFilePath = path12.join(cwd, "pod.deploy.yml");
|
|
4645
|
+
await fs9.writeFile(deployFilePath, deployFile);
|
|
4646
|
+
}
|
|
4544
4647
|
async function setupProduction(cwd, projectName, services) {
|
|
4545
4648
|
const compose = {
|
|
4546
4649
|
services: {
|
|
@@ -4558,6 +4661,10 @@ async function setupProduction(cwd, projectName, services) {
|
|
|
4558
4661
|
],
|
|
4559
4662
|
labels: [
|
|
4560
4663
|
"traefik.enable=true",
|
|
4664
|
+
"traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)",
|
|
4665
|
+
"traefik.http.routers.http-catchall.entrypoints=web",
|
|
4666
|
+
"traefik.http.routers.http-catchall.middlewares=redirect-to-https",
|
|
4667
|
+
"traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https",
|
|
4561
4668
|
"traefik.http.routers.dashboard.rule=Host(`traefik.${HOST}`)",
|
|
4562
4669
|
"traefik.http.routers.dashboard.entrypoints=websecure",
|
|
4563
4670
|
"traefik.http.routers.dashboard.tls.certresolver=myresolver",
|
|
@@ -5281,8 +5388,8 @@ async function handleVerify(op, shell, target) {
|
|
|
5281
5388
|
// src/main.ts
|
|
5282
5389
|
import chalk2 from "chalk";
|
|
5283
5390
|
var program = new Command();
|
|
5284
|
-
program.name("pod").description("Pod cli tool").version("1.0.
|
|
5285
|
-
program.command("new <name>").description("Start a new
|
|
5391
|
+
program.name("pod").description("Pod cli tool").version("1.0.22");
|
|
5392
|
+
program.command("new <name>").description("Start a new Orca Project").action(async (name) => {
|
|
5286
5393
|
await addNew(name);
|
|
5287
5394
|
const appDir = path14.resolve(process.cwd(), name);
|
|
5288
5395
|
const shell = process.platform === "win32" ? process.env.ComSpec || "cmd.exe" : "/bin/sh";
|