@serve.zone/cli 5.0.3 β 5.3.0
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 +4 -4
- package/readme.md +283 -187
- package/ts_cliclient/readme.md +283 -187
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serve.zone/cli",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"exports": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@serve.zone/api": "5.0
|
|
13
|
-
"@serve.zone/interfaces": "5.0
|
|
12
|
+
"@serve.zone/api": "5.3.0",
|
|
13
|
+
"@serve.zone/interfaces": "5.3.0",
|
|
14
14
|
"@push.rocks/projectinfo": "^5.0.1",
|
|
15
|
-
"@push.rocks/qenv": "^6.1.
|
|
15
|
+
"@push.rocks/qenv": "^6.1.3",
|
|
16
16
|
"@push.rocks/smartcli": "^4.0.11"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
package/readme.md
CHANGED
|
@@ -1,246 +1,342 @@
|
|
|
1
|
-
# @serve.zone/cli
|
|
1
|
+
# @serve.zone/cli π
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Command-line interface for Cloudly.** Manage your multi-cloud infrastructure from the terminal with powerful, intuitive commands.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## π― What is @serve.zone/cli?
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The Cloudly CLI brings the full power of the Cloudly platform to your terminal. Whether you're automating deployments, managing secrets, or monitoring services, the CLI provides a streamlined interface for all your cloud operations.
|
|
8
|
+
|
|
9
|
+
## β¨ Features
|
|
10
|
+
|
|
11
|
+
- **β‘ Fast & Efficient** - Optimized for speed and minimal resource usage
|
|
12
|
+
- **π Secure Authentication** - Token-based authentication with secure storage
|
|
13
|
+
- **π Intuitive Commands** - Clear, consistent command structure
|
|
14
|
+
- **π¨ Formatted Output** - Beautiful, readable output with color coding
|
|
15
|
+
- **π Scriptable** - Perfect for CI/CD pipelines and automation
|
|
16
|
+
- **π Comprehensive** - Access to all Cloudly features from the terminal
|
|
17
|
+
|
|
18
|
+
## π Installation
|
|
19
|
+
|
|
20
|
+
### Global Installation (Recommended)
|
|
8
21
|
|
|
9
22
|
```bash
|
|
10
|
-
|
|
23
|
+
pnpm add -g @serve.zone/cli
|
|
11
24
|
```
|
|
12
25
|
|
|
13
|
-
|
|
26
|
+
### Local Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm add @serve.zone/cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## π¬ Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Configure your Cloudly instance
|
|
36
|
+
servezone config --url https://cloudly.example.com
|
|
14
37
|
|
|
15
|
-
|
|
38
|
+
# Login with your service token
|
|
39
|
+
servezone login --token your-service-token
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
# List your clusters
|
|
42
|
+
servezone clusters list
|
|
18
43
|
|
|
19
|
-
|
|
44
|
+
# Deploy a service
|
|
45
|
+
servezone deploy --cluster production --image myapp:latest
|
|
46
|
+
```
|
|
20
47
|
|
|
21
|
-
|
|
22
|
-
- Latest Node.js LTS version installed.
|
|
23
|
-
- Familiarity with basic command-line operations.
|
|
24
|
-
- Properly configured cloud service accounts (like Cloudflare, Hetzner), necessary for managing respective services.
|
|
48
|
+
## π Authentication
|
|
25
49
|
|
|
26
|
-
###
|
|
50
|
+
### Initial Setup
|
|
27
51
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { Cloudly } from '@serve.zone/cloudly';
|
|
32
|
-
import * as path from 'path';
|
|
52
|
+
```bash
|
|
53
|
+
# Set your Cloudly instance URL
|
|
54
|
+
servezone config --url https://cloudly.example.com
|
|
33
55
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
56
|
+
# Authenticate with a service token
|
|
57
|
+
servezone login --token YOUR_SERVICE_TOKEN
|
|
58
|
+
|
|
59
|
+
# Or use environment variables
|
|
60
|
+
export CLOUDLY_URL=https://cloudly.example.com
|
|
61
|
+
export CLOUDLY_TOKEN=YOUR_SERVICE_TOKEN
|
|
62
|
+
```
|
|
41
63
|
|
|
42
|
-
|
|
43
|
-
const cloudlyInstance = new Cloudly(cloudlyConfig);
|
|
44
|
-
await cloudlyInstance.start();
|
|
64
|
+
### Managing Profiles
|
|
45
65
|
|
|
46
|
-
|
|
47
|
-
|
|
66
|
+
```bash
|
|
67
|
+
# Create a profile for different environments
|
|
68
|
+
servezone profile create production --url https://prod.cloudly.com
|
|
69
|
+
servezone profile create staging --url https://stage.cloudly.com
|
|
70
|
+
|
|
71
|
+
# Switch between profiles
|
|
72
|
+
servezone profile use production
|
|
73
|
+
|
|
74
|
+
# List all profiles
|
|
75
|
+
servezone profile list
|
|
48
76
|
```
|
|
49
77
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
## π Core Commands
|
|
79
|
+
|
|
80
|
+
### π Cluster Management
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# List all clusters
|
|
84
|
+
servezone clusters list
|
|
85
|
+
|
|
86
|
+
# Get cluster details
|
|
87
|
+
servezone clusters info production-cluster
|
|
88
|
+
|
|
89
|
+
# Create a new cluster
|
|
90
|
+
servezone clusters create \
|
|
91
|
+
--name production-cluster \
|
|
92
|
+
--region eu-central \
|
|
93
|
+
--nodes 3
|
|
94
|
+
|
|
95
|
+
# Scale a cluster
|
|
96
|
+
servezone clusters scale production-cluster --nodes 5
|
|
97
|
+
|
|
98
|
+
# Delete a cluster
|
|
99
|
+
servezone clusters delete staging-cluster
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### π³ Service Deployment
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Deploy a service
|
|
106
|
+
servezone deploy \
|
|
107
|
+
--cluster production \
|
|
108
|
+
--name api-service \
|
|
109
|
+
--image myapp:2.0.0 \
|
|
110
|
+
--replicas 3 \
|
|
111
|
+
--port 80:3000
|
|
112
|
+
|
|
113
|
+
# Update a service
|
|
114
|
+
servezone service update api-service \
|
|
115
|
+
--image myapp:2.1.0 \
|
|
116
|
+
--replicas 5
|
|
117
|
+
|
|
118
|
+
# Scale a service
|
|
119
|
+
servezone service scale api-service --replicas 10
|
|
120
|
+
|
|
121
|
+
# Remove a service
|
|
122
|
+
servezone service remove api-service
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### π Secret Management
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Create a secret
|
|
129
|
+
servezone secrets create \
|
|
130
|
+
--name database-url \
|
|
131
|
+
--value "postgres://user:pass@host/db"
|
|
132
|
+
|
|
133
|
+
# Create a secret group
|
|
134
|
+
servezone secrets create-group \
|
|
135
|
+
--name api-secrets \
|
|
136
|
+
--secret DATABASE_URL=postgres://... \
|
|
137
|
+
--secret REDIS_URL=redis://...
|
|
138
|
+
|
|
139
|
+
# List secrets
|
|
140
|
+
servezone secrets list
|
|
141
|
+
|
|
142
|
+
# Get secret value
|
|
143
|
+
servezone secrets get database-url
|
|
144
|
+
|
|
145
|
+
# Delete a secret
|
|
146
|
+
servezone secrets delete old-secret
|
|
89
147
|
```
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// Deploy a new service to a specified cluster
|
|
110
|
-
const newService = {
|
|
111
|
-
id: 'example_service_id',
|
|
112
|
-
data: {
|
|
113
|
-
name: 'example_service',
|
|
114
|
-
imageId: 'example_image_id',
|
|
115
|
-
imageVersion: '1.0.0',
|
|
116
|
-
environment: {},
|
|
117
|
-
ports: { web: 80 }
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// Store service into database and deploy
|
|
122
|
-
console.log('Deploying service:', newService)
|
|
123
|
-
await cloudlyInstance.serverManager.deployService(newService);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
deployService();
|
|
148
|
+
|
|
149
|
+
### π¦ Image Management
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# List images
|
|
153
|
+
servezone images list
|
|
154
|
+
|
|
155
|
+
# Push a new image
|
|
156
|
+
servezone images push \
|
|
157
|
+
--name myapp \
|
|
158
|
+
--version 2.0.0 \
|
|
159
|
+
--file ./myapp.tar
|
|
160
|
+
|
|
161
|
+
# Tag an image
|
|
162
|
+
servezone images tag myapp:2.0.0 myapp:latest
|
|
163
|
+
|
|
164
|
+
# Delete an image
|
|
165
|
+
servezone images delete myapp:1.0.0
|
|
127
166
|
```
|
|
128
167
|
|
|
129
|
-
|
|
168
|
+
### π Monitoring & Logs
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# View service logs
|
|
172
|
+
servezone logs api-service
|
|
173
|
+
|
|
174
|
+
# Follow logs in real-time
|
|
175
|
+
servezone logs api-service --follow
|
|
130
176
|
|
|
131
|
-
|
|
177
|
+
# Filter logs
|
|
178
|
+
servezone logs api-service --since 1h --grep ERROR
|
|
132
179
|
|
|
133
|
-
|
|
180
|
+
# Get service status
|
|
181
|
+
servezone service status api-service
|
|
134
182
|
|
|
135
|
-
|
|
136
|
-
|
|
183
|
+
# Monitor cluster health
|
|
184
|
+
servezone clusters health production-cluster
|
|
185
|
+
```
|
|
137
186
|
|
|
138
|
-
|
|
139
|
-
async function getCertificate() {
|
|
140
|
-
const config = {
|
|
141
|
-
cfToken: 'YOUR_CLOUDFLARE_TOKEN',
|
|
142
|
-
hetznerToken: 'YOUR_HETZNER_TOKEN',
|
|
143
|
-
};
|
|
187
|
+
### π§ DNS Management
|
|
144
188
|
|
|
145
|
-
|
|
146
|
-
|
|
189
|
+
```bash
|
|
190
|
+
# List DNS records
|
|
191
|
+
servezone dns list --domain example.com
|
|
147
192
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
193
|
+
# Create a DNS record
|
|
194
|
+
servezone dns create \
|
|
195
|
+
--domain example.com \
|
|
196
|
+
--name api \
|
|
197
|
+
--type A \
|
|
198
|
+
--value 192.168.1.1
|
|
153
199
|
|
|
154
|
-
|
|
200
|
+
# Update a DNS record
|
|
201
|
+
servezone dns update api.example.com --value 192.168.1.2
|
|
202
|
+
|
|
203
|
+
# Delete a DNS record
|
|
204
|
+
servezone dns delete old.example.com
|
|
155
205
|
```
|
|
156
206
|
|
|
157
|
-
|
|
207
|
+
## π― Advanced Usage
|
|
158
208
|
|
|
159
|
-
###
|
|
209
|
+
### Environment Variables
|
|
160
210
|
|
|
161
|
-
|
|
211
|
+
```bash
|
|
212
|
+
# Set environment variables for a service
|
|
213
|
+
servezone deploy \
|
|
214
|
+
--name api-service \
|
|
215
|
+
--env NODE_ENV=production \
|
|
216
|
+
--env PORT=3000 \
|
|
217
|
+
--env DATABASE_URL=@secret:database-url
|
|
218
|
+
```
|
|
162
219
|
|
|
163
|
-
|
|
164
|
-
|
|
220
|
+
### Configuration Files
|
|
221
|
+
|
|
222
|
+
Create a `cloudly.yaml` file:
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
cluster: production
|
|
226
|
+
service:
|
|
227
|
+
name: api-service
|
|
228
|
+
image: myapp:latest
|
|
229
|
+
replicas: 3
|
|
230
|
+
ports:
|
|
231
|
+
- 80:3000
|
|
232
|
+
environment:
|
|
233
|
+
NODE_ENV: production
|
|
234
|
+
DATABASE_URL: "@secret:database-url"
|
|
235
|
+
```
|
|
165
236
|
|
|
166
|
-
|
|
167
|
-
const dailyTask = new TaskBuffer({
|
|
168
|
-
schedule: '0 0 * * *', // Using cron schedule
|
|
169
|
-
taskFunction: async () => {
|
|
170
|
-
console.log('Performing daily backup check...');
|
|
171
|
-
// Include backup logic here
|
|
172
|
-
},
|
|
173
|
-
});
|
|
237
|
+
Deploy using the config file:
|
|
174
238
|
|
|
175
|
-
|
|
176
|
-
|
|
239
|
+
```bash
|
|
240
|
+
servezone deploy --config cloudly.yaml
|
|
177
241
|
```
|
|
178
242
|
|
|
179
|
-
|
|
243
|
+
### Batch Operations
|
|
180
244
|
|
|
181
|
-
|
|
245
|
+
```bash
|
|
246
|
+
# Deploy multiple services
|
|
247
|
+
servezone deploy --config services/*.yaml
|
|
182
248
|
|
|
183
|
-
|
|
249
|
+
# Update all services in a namespace
|
|
250
|
+
servezone service update --namespace api --image-tag v2.0.0
|
|
184
251
|
|
|
185
|
-
|
|
186
|
-
|
|
252
|
+
# Delete all staging resources
|
|
253
|
+
servezone cleanup --environment staging
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## π CI/CD Integration
|
|
187
257
|
|
|
188
|
-
|
|
189
|
-
async function sendNotification() {
|
|
190
|
-
const cloudlyConfig = {
|
|
191
|
-
cfToken: 'your-cloudflare-token',
|
|
192
|
-
hetznerToken: 'your-hetzner-token',
|
|
193
|
-
};
|
|
258
|
+
### GitHub Actions
|
|
194
259
|
|
|
195
|
-
|
|
196
|
-
|
|
260
|
+
```yaml
|
|
261
|
+
- name: Deploy to Cloudly
|
|
262
|
+
run: |
|
|
263
|
+
servezone config --url ${{ secrets.CLOUDLY_URL }}
|
|
264
|
+
servezone login --token ${{ secrets.CLOUDLY_TOKEN }}
|
|
265
|
+
servezone deploy \
|
|
266
|
+
--cluster production \
|
|
267
|
+
--name api-service \
|
|
268
|
+
--image myapp:${{ github.sha }}
|
|
269
|
+
```
|
|
197
270
|
|
|
198
|
-
|
|
199
|
-
await cloudly.externalApiManager.sendPushMessage({
|
|
200
|
-
deviceToken: 'some_device_token',
|
|
201
|
-
message: 'Hello from Cloudly!',
|
|
202
|
-
});
|
|
203
|
-
}
|
|
271
|
+
### GitLab CI
|
|
204
272
|
|
|
205
|
-
|
|
273
|
+
```yaml
|
|
274
|
+
deploy:
|
|
275
|
+
script:
|
|
276
|
+
- servezone config --url $CLOUDLY_URL
|
|
277
|
+
- servezone login --token $CLOUDLY_TOKEN
|
|
278
|
+
- servezone deploy --config cloudly.yaml
|
|
206
279
|
```
|
|
207
280
|
|
|
208
|
-
|
|
281
|
+
## π¨ Output Formats
|
|
209
282
|
|
|
210
|
-
|
|
283
|
+
```bash
|
|
284
|
+
# JSON output for scripting
|
|
285
|
+
servezone clusters list --output json
|
|
211
286
|
|
|
212
|
-
|
|
287
|
+
# YAML output
|
|
288
|
+
servezone service info api-service --output yaml
|
|
213
289
|
|
|
214
|
-
|
|
215
|
-
|
|
290
|
+
# Table output (default)
|
|
291
|
+
servezone images list --output table
|
|
216
292
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
cfToken: 'your-cloudflare-token',
|
|
221
|
-
hetznerToken: 'your-hetzner-token',
|
|
222
|
-
};
|
|
293
|
+
# Quiet mode (IDs only)
|
|
294
|
+
servezone clusters list --quiet
|
|
295
|
+
```
|
|
223
296
|
|
|
224
|
-
|
|
225
|
-
await cloudly.start();
|
|
297
|
+
## π οΈ Troubleshooting
|
|
226
298
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
299
|
+
```bash
|
|
300
|
+
# Enable debug output
|
|
301
|
+
servezone --debug clusters list
|
|
302
|
+
|
|
303
|
+
# Check CLI version
|
|
304
|
+
servezone version
|
|
232
305
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
console.log(`Is user identity valid? ${isValid}`);
|
|
236
|
-
}
|
|
306
|
+
# Test connection
|
|
307
|
+
servezone ping
|
|
237
308
|
|
|
238
|
-
|
|
309
|
+
# View configuration
|
|
310
|
+
servezone config show
|
|
311
|
+
|
|
312
|
+
# Clear cache and credentials
|
|
313
|
+
servezone logout --clear-cache
|
|
239
314
|
```
|
|
240
315
|
|
|
241
|
-
|
|
316
|
+
## π Command Reference
|
|
242
317
|
|
|
243
|
-
|
|
318
|
+
```bash
|
|
319
|
+
servezone --help # Show all commands
|
|
320
|
+
servezone <command> --help # Show command-specific help
|
|
321
|
+
servezone clusters --help # Show cluster commands
|
|
322
|
+
servezone service --help # Show service commands
|
|
323
|
+
servezone secrets --help # Show secret commands
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## π Shell Completion
|
|
327
|
+
|
|
328
|
+
Enable tab completion for your shell:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Bash
|
|
332
|
+
servezone completion bash > /etc/bash_completion.d/servezone
|
|
333
|
+
|
|
334
|
+
# Zsh
|
|
335
|
+
servezone completion zsh > ~/.zsh/completions/_servezone
|
|
336
|
+
|
|
337
|
+
# Fish
|
|
338
|
+
servezone completion fish > ~/.config/fish/completions/servezone.fish
|
|
339
|
+
```
|
|
244
340
|
|
|
245
341
|
## License and Legal Information
|
|
246
342
|
|
|
@@ -259,4 +355,4 @@ Registered at District court Bremen HRB 35230 HB, Germany
|
|
|
259
355
|
|
|
260
356
|
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
261
357
|
|
|
262
|
-
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
358
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
package/ts_cliclient/readme.md
CHANGED
|
@@ -1,246 +1,342 @@
|
|
|
1
|
-
# @serve.zone/cli
|
|
1
|
+
# @serve.zone/cli π
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Command-line interface for Cloudly.** Manage your multi-cloud infrastructure from the terminal with powerful, intuitive commands.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## π― What is @serve.zone/cli?
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The Cloudly CLI brings the full power of the Cloudly platform to your terminal. Whether you're automating deployments, managing secrets, or monitoring services, the CLI provides a streamlined interface for all your cloud operations.
|
|
8
|
+
|
|
9
|
+
## β¨ Features
|
|
10
|
+
|
|
11
|
+
- **β‘ Fast & Efficient** - Optimized for speed and minimal resource usage
|
|
12
|
+
- **π Secure Authentication** - Token-based authentication with secure storage
|
|
13
|
+
- **π Intuitive Commands** - Clear, consistent command structure
|
|
14
|
+
- **π¨ Formatted Output** - Beautiful, readable output with color coding
|
|
15
|
+
- **π Scriptable** - Perfect for CI/CD pipelines and automation
|
|
16
|
+
- **π Comprehensive** - Access to all Cloudly features from the terminal
|
|
17
|
+
|
|
18
|
+
## π Installation
|
|
19
|
+
|
|
20
|
+
### Global Installation (Recommended)
|
|
8
21
|
|
|
9
22
|
```bash
|
|
10
|
-
|
|
23
|
+
pnpm add -g @serve.zone/cli
|
|
11
24
|
```
|
|
12
25
|
|
|
13
|
-
|
|
26
|
+
### Local Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm add @serve.zone/cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## π¬ Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Configure your Cloudly instance
|
|
36
|
+
servezone config --url https://cloudly.example.com
|
|
14
37
|
|
|
15
|
-
|
|
38
|
+
# Login with your service token
|
|
39
|
+
servezone login --token your-service-token
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
# List your clusters
|
|
42
|
+
servezone clusters list
|
|
18
43
|
|
|
19
|
-
|
|
44
|
+
# Deploy a service
|
|
45
|
+
servezone deploy --cluster production --image myapp:latest
|
|
46
|
+
```
|
|
20
47
|
|
|
21
|
-
|
|
22
|
-
- Latest Node.js LTS version installed.
|
|
23
|
-
- Familiarity with basic command-line operations.
|
|
24
|
-
- Properly configured cloud service accounts (like Cloudflare, Hetzner), necessary for managing respective services.
|
|
48
|
+
## π Authentication
|
|
25
49
|
|
|
26
|
-
###
|
|
50
|
+
### Initial Setup
|
|
27
51
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { Cloudly } from '@serve.zone/cloudly';
|
|
32
|
-
import * as path from 'path';
|
|
52
|
+
```bash
|
|
53
|
+
# Set your Cloudly instance URL
|
|
54
|
+
servezone config --url https://cloudly.example.com
|
|
33
55
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
56
|
+
# Authenticate with a service token
|
|
57
|
+
servezone login --token YOUR_SERVICE_TOKEN
|
|
58
|
+
|
|
59
|
+
# Or use environment variables
|
|
60
|
+
export CLOUDLY_URL=https://cloudly.example.com
|
|
61
|
+
export CLOUDLY_TOKEN=YOUR_SERVICE_TOKEN
|
|
62
|
+
```
|
|
41
63
|
|
|
42
|
-
|
|
43
|
-
const cloudlyInstance = new Cloudly(cloudlyConfig);
|
|
44
|
-
await cloudlyInstance.start();
|
|
64
|
+
### Managing Profiles
|
|
45
65
|
|
|
46
|
-
|
|
47
|
-
|
|
66
|
+
```bash
|
|
67
|
+
# Create a profile for different environments
|
|
68
|
+
servezone profile create production --url https://prod.cloudly.com
|
|
69
|
+
servezone profile create staging --url https://stage.cloudly.com
|
|
70
|
+
|
|
71
|
+
# Switch between profiles
|
|
72
|
+
servezone profile use production
|
|
73
|
+
|
|
74
|
+
# List all profiles
|
|
75
|
+
servezone profile list
|
|
48
76
|
```
|
|
49
77
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
## π Core Commands
|
|
79
|
+
|
|
80
|
+
### π Cluster Management
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# List all clusters
|
|
84
|
+
servezone clusters list
|
|
85
|
+
|
|
86
|
+
# Get cluster details
|
|
87
|
+
servezone clusters info production-cluster
|
|
88
|
+
|
|
89
|
+
# Create a new cluster
|
|
90
|
+
servezone clusters create \
|
|
91
|
+
--name production-cluster \
|
|
92
|
+
--region eu-central \
|
|
93
|
+
--nodes 3
|
|
94
|
+
|
|
95
|
+
# Scale a cluster
|
|
96
|
+
servezone clusters scale production-cluster --nodes 5
|
|
97
|
+
|
|
98
|
+
# Delete a cluster
|
|
99
|
+
servezone clusters delete staging-cluster
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### π³ Service Deployment
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Deploy a service
|
|
106
|
+
servezone deploy \
|
|
107
|
+
--cluster production \
|
|
108
|
+
--name api-service \
|
|
109
|
+
--image myapp:2.0.0 \
|
|
110
|
+
--replicas 3 \
|
|
111
|
+
--port 80:3000
|
|
112
|
+
|
|
113
|
+
# Update a service
|
|
114
|
+
servezone service update api-service \
|
|
115
|
+
--image myapp:2.1.0 \
|
|
116
|
+
--replicas 5
|
|
117
|
+
|
|
118
|
+
# Scale a service
|
|
119
|
+
servezone service scale api-service --replicas 10
|
|
120
|
+
|
|
121
|
+
# Remove a service
|
|
122
|
+
servezone service remove api-service
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### π Secret Management
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Create a secret
|
|
129
|
+
servezone secrets create \
|
|
130
|
+
--name database-url \
|
|
131
|
+
--value "postgres://user:pass@host/db"
|
|
132
|
+
|
|
133
|
+
# Create a secret group
|
|
134
|
+
servezone secrets create-group \
|
|
135
|
+
--name api-secrets \
|
|
136
|
+
--secret DATABASE_URL=postgres://... \
|
|
137
|
+
--secret REDIS_URL=redis://...
|
|
138
|
+
|
|
139
|
+
# List secrets
|
|
140
|
+
servezone secrets list
|
|
141
|
+
|
|
142
|
+
# Get secret value
|
|
143
|
+
servezone secrets get database-url
|
|
144
|
+
|
|
145
|
+
# Delete a secret
|
|
146
|
+
servezone secrets delete old-secret
|
|
89
147
|
```
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// Deploy a new service to a specified cluster
|
|
110
|
-
const newService = {
|
|
111
|
-
id: 'example_service_id',
|
|
112
|
-
data: {
|
|
113
|
-
name: 'example_service',
|
|
114
|
-
imageId: 'example_image_id',
|
|
115
|
-
imageVersion: '1.0.0',
|
|
116
|
-
environment: {},
|
|
117
|
-
ports: { web: 80 }
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// Store service into database and deploy
|
|
122
|
-
console.log('Deploying service:', newService)
|
|
123
|
-
await cloudlyInstance.serverManager.deployService(newService);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
deployService();
|
|
148
|
+
|
|
149
|
+
### π¦ Image Management
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# List images
|
|
153
|
+
servezone images list
|
|
154
|
+
|
|
155
|
+
# Push a new image
|
|
156
|
+
servezone images push \
|
|
157
|
+
--name myapp \
|
|
158
|
+
--version 2.0.0 \
|
|
159
|
+
--file ./myapp.tar
|
|
160
|
+
|
|
161
|
+
# Tag an image
|
|
162
|
+
servezone images tag myapp:2.0.0 myapp:latest
|
|
163
|
+
|
|
164
|
+
# Delete an image
|
|
165
|
+
servezone images delete myapp:1.0.0
|
|
127
166
|
```
|
|
128
167
|
|
|
129
|
-
|
|
168
|
+
### π Monitoring & Logs
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# View service logs
|
|
172
|
+
servezone logs api-service
|
|
173
|
+
|
|
174
|
+
# Follow logs in real-time
|
|
175
|
+
servezone logs api-service --follow
|
|
130
176
|
|
|
131
|
-
|
|
177
|
+
# Filter logs
|
|
178
|
+
servezone logs api-service --since 1h --grep ERROR
|
|
132
179
|
|
|
133
|
-
|
|
180
|
+
# Get service status
|
|
181
|
+
servezone service status api-service
|
|
134
182
|
|
|
135
|
-
|
|
136
|
-
|
|
183
|
+
# Monitor cluster health
|
|
184
|
+
servezone clusters health production-cluster
|
|
185
|
+
```
|
|
137
186
|
|
|
138
|
-
|
|
139
|
-
async function getCertificate() {
|
|
140
|
-
const config = {
|
|
141
|
-
cfToken: 'YOUR_CLOUDFLARE_TOKEN',
|
|
142
|
-
hetznerToken: 'YOUR_HETZNER_TOKEN',
|
|
143
|
-
};
|
|
187
|
+
### π§ DNS Management
|
|
144
188
|
|
|
145
|
-
|
|
146
|
-
|
|
189
|
+
```bash
|
|
190
|
+
# List DNS records
|
|
191
|
+
servezone dns list --domain example.com
|
|
147
192
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
193
|
+
# Create a DNS record
|
|
194
|
+
servezone dns create \
|
|
195
|
+
--domain example.com \
|
|
196
|
+
--name api \
|
|
197
|
+
--type A \
|
|
198
|
+
--value 192.168.1.1
|
|
153
199
|
|
|
154
|
-
|
|
200
|
+
# Update a DNS record
|
|
201
|
+
servezone dns update api.example.com --value 192.168.1.2
|
|
202
|
+
|
|
203
|
+
# Delete a DNS record
|
|
204
|
+
servezone dns delete old.example.com
|
|
155
205
|
```
|
|
156
206
|
|
|
157
|
-
|
|
207
|
+
## π― Advanced Usage
|
|
158
208
|
|
|
159
|
-
###
|
|
209
|
+
### Environment Variables
|
|
160
210
|
|
|
161
|
-
|
|
211
|
+
```bash
|
|
212
|
+
# Set environment variables for a service
|
|
213
|
+
servezone deploy \
|
|
214
|
+
--name api-service \
|
|
215
|
+
--env NODE_ENV=production \
|
|
216
|
+
--env PORT=3000 \
|
|
217
|
+
--env DATABASE_URL=@secret:database-url
|
|
218
|
+
```
|
|
162
219
|
|
|
163
|
-
|
|
164
|
-
|
|
220
|
+
### Configuration Files
|
|
221
|
+
|
|
222
|
+
Create a `cloudly.yaml` file:
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
cluster: production
|
|
226
|
+
service:
|
|
227
|
+
name: api-service
|
|
228
|
+
image: myapp:latest
|
|
229
|
+
replicas: 3
|
|
230
|
+
ports:
|
|
231
|
+
- 80:3000
|
|
232
|
+
environment:
|
|
233
|
+
NODE_ENV: production
|
|
234
|
+
DATABASE_URL: "@secret:database-url"
|
|
235
|
+
```
|
|
165
236
|
|
|
166
|
-
|
|
167
|
-
const dailyTask = new TaskBuffer({
|
|
168
|
-
schedule: '0 0 * * *', // Using cron schedule
|
|
169
|
-
taskFunction: async () => {
|
|
170
|
-
console.log('Performing daily backup check...');
|
|
171
|
-
// Include backup logic here
|
|
172
|
-
},
|
|
173
|
-
});
|
|
237
|
+
Deploy using the config file:
|
|
174
238
|
|
|
175
|
-
|
|
176
|
-
|
|
239
|
+
```bash
|
|
240
|
+
servezone deploy --config cloudly.yaml
|
|
177
241
|
```
|
|
178
242
|
|
|
179
|
-
|
|
243
|
+
### Batch Operations
|
|
180
244
|
|
|
181
|
-
|
|
245
|
+
```bash
|
|
246
|
+
# Deploy multiple services
|
|
247
|
+
servezone deploy --config services/*.yaml
|
|
182
248
|
|
|
183
|
-
|
|
249
|
+
# Update all services in a namespace
|
|
250
|
+
servezone service update --namespace api --image-tag v2.0.0
|
|
184
251
|
|
|
185
|
-
|
|
186
|
-
|
|
252
|
+
# Delete all staging resources
|
|
253
|
+
servezone cleanup --environment staging
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## π CI/CD Integration
|
|
187
257
|
|
|
188
|
-
|
|
189
|
-
async function sendNotification() {
|
|
190
|
-
const cloudlyConfig = {
|
|
191
|
-
cfToken: 'your-cloudflare-token',
|
|
192
|
-
hetznerToken: 'your-hetzner-token',
|
|
193
|
-
};
|
|
258
|
+
### GitHub Actions
|
|
194
259
|
|
|
195
|
-
|
|
196
|
-
|
|
260
|
+
```yaml
|
|
261
|
+
- name: Deploy to Cloudly
|
|
262
|
+
run: |
|
|
263
|
+
servezone config --url ${{ secrets.CLOUDLY_URL }}
|
|
264
|
+
servezone login --token ${{ secrets.CLOUDLY_TOKEN }}
|
|
265
|
+
servezone deploy \
|
|
266
|
+
--cluster production \
|
|
267
|
+
--name api-service \
|
|
268
|
+
--image myapp:${{ github.sha }}
|
|
269
|
+
```
|
|
197
270
|
|
|
198
|
-
|
|
199
|
-
await cloudly.externalApiManager.sendPushMessage({
|
|
200
|
-
deviceToken: 'some_device_token',
|
|
201
|
-
message: 'Hello from Cloudly!',
|
|
202
|
-
});
|
|
203
|
-
}
|
|
271
|
+
### GitLab CI
|
|
204
272
|
|
|
205
|
-
|
|
273
|
+
```yaml
|
|
274
|
+
deploy:
|
|
275
|
+
script:
|
|
276
|
+
- servezone config --url $CLOUDLY_URL
|
|
277
|
+
- servezone login --token $CLOUDLY_TOKEN
|
|
278
|
+
- servezone deploy --config cloudly.yaml
|
|
206
279
|
```
|
|
207
280
|
|
|
208
|
-
|
|
281
|
+
## π¨ Output Formats
|
|
209
282
|
|
|
210
|
-
|
|
283
|
+
```bash
|
|
284
|
+
# JSON output for scripting
|
|
285
|
+
servezone clusters list --output json
|
|
211
286
|
|
|
212
|
-
|
|
287
|
+
# YAML output
|
|
288
|
+
servezone service info api-service --output yaml
|
|
213
289
|
|
|
214
|
-
|
|
215
|
-
|
|
290
|
+
# Table output (default)
|
|
291
|
+
servezone images list --output table
|
|
216
292
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
cfToken: 'your-cloudflare-token',
|
|
221
|
-
hetznerToken: 'your-hetzner-token',
|
|
222
|
-
};
|
|
293
|
+
# Quiet mode (IDs only)
|
|
294
|
+
servezone clusters list --quiet
|
|
295
|
+
```
|
|
223
296
|
|
|
224
|
-
|
|
225
|
-
await cloudly.start();
|
|
297
|
+
## π οΈ Troubleshooting
|
|
226
298
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
299
|
+
```bash
|
|
300
|
+
# Enable debug output
|
|
301
|
+
servezone --debug clusters list
|
|
302
|
+
|
|
303
|
+
# Check CLI version
|
|
304
|
+
servezone version
|
|
232
305
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
console.log(`Is user identity valid? ${isValid}`);
|
|
236
|
-
}
|
|
306
|
+
# Test connection
|
|
307
|
+
servezone ping
|
|
237
308
|
|
|
238
|
-
|
|
309
|
+
# View configuration
|
|
310
|
+
servezone config show
|
|
311
|
+
|
|
312
|
+
# Clear cache and credentials
|
|
313
|
+
servezone logout --clear-cache
|
|
239
314
|
```
|
|
240
315
|
|
|
241
|
-
|
|
316
|
+
## π Command Reference
|
|
242
317
|
|
|
243
|
-
|
|
318
|
+
```bash
|
|
319
|
+
servezone --help # Show all commands
|
|
320
|
+
servezone <command> --help # Show command-specific help
|
|
321
|
+
servezone clusters --help # Show cluster commands
|
|
322
|
+
servezone service --help # Show service commands
|
|
323
|
+
servezone secrets --help # Show secret commands
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## π Shell Completion
|
|
327
|
+
|
|
328
|
+
Enable tab completion for your shell:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Bash
|
|
332
|
+
servezone completion bash > /etc/bash_completion.d/servezone
|
|
333
|
+
|
|
334
|
+
# Zsh
|
|
335
|
+
servezone completion zsh > ~/.zsh/completions/_servezone
|
|
336
|
+
|
|
337
|
+
# Fish
|
|
338
|
+
servezone completion fish > ~/.config/fish/completions/servezone.fish
|
|
339
|
+
```
|
|
244
340
|
|
|
245
341
|
## License and Legal Information
|
|
246
342
|
|
|
@@ -259,4 +355,4 @@ Registered at District court Bremen HRB 35230 HB, Germany
|
|
|
259
355
|
|
|
260
356
|
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
261
357
|
|
|
262
|
-
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
358
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|