rushdeploy 1.0.7 → 1.0.9
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 +68 -68
- package/bin/index.js +53 -124
- package/package.json +23 -23
package/README.md
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# RushDeploy CLI (Node.js Package)
|
|
2
|
-
|
|
3
|
-
A zero-dependency Node.js command-line utility to manage your self-hosted RushDeploy PaaS account.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Install the package globally via npm:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g rushdeploy
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Quickstart
|
|
18
|
-
|
|
19
|
-
### 1. Authenticate with your server
|
|
20
|
-
Generate a CLI token in Settings inside the Web Dashboard and log in:
|
|
21
|
-
```bash
|
|
22
|
-
rushdeploy login <token>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### 2. Check Workspace Status
|
|
26
|
-
```bash
|
|
27
|
-
# Displays workspace resource quotas and allocations
|
|
28
|
-
rushdeploy status
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 3. Deploy a project
|
|
32
|
-
Deploy a public Git repository:
|
|
33
|
-
```bash
|
|
34
|
-
rushdeploy deploy git https://github.com/my-username/my-react-app.git --branch main --type react
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Commands Reference
|
|
40
|
-
|
|
41
|
-
* **`rushdeploy login <token>`**: Authenticate CLI session.
|
|
42
|
-
* **`rushdeploy logout`**: Clear local auth details.
|
|
43
|
-
* **`rushdeploy whoami`**: View details of the active user profile.
|
|
44
|
-
* **`rushdeploy status`**: Render resource metrics cards.
|
|
45
|
-
* **`rushdeploy plans`**: Show plan pricing quotas.
|
|
46
|
-
* **`rushdeploy projects`**: List active projects.
|
|
47
|
-
* **`rushdeploy repos`**: List repos in connected GitHub profile.
|
|
48
|
-
* **`rushdeploy workspace`**: Display resource usage limits and quotas.
|
|
49
|
-
* **`rushdeploy help`**: Show the CLI help dialog.
|
|
50
|
-
|
|
51
|
-
### Deployments
|
|
52
|
-
* **`rushdeploy deploy git <url> [opts]`**: Trigger deployment from a Git clone URL.
|
|
53
|
-
* *Options: `--name <name>`, `--branch <branch>`, `--type <framework>`*
|
|
54
|
-
* **`rushdeploy deploy repo <owner/repo> [opts]`**: Trigger deployment from your connected GitHub account.
|
|
55
|
-
* *Options: `--name <name>`, `--branch <branch>`, `--type <framework>`*
|
|
56
|
-
* **`rushdeploy deploy wordpress <name> --email <e> [opts]`**: Provision a new WordPress site instance.
|
|
57
|
-
* *Options: `--title <title>`, `--user <user>`, `--password <pass>`*
|
|
58
|
-
|
|
59
|
-
### Project Control
|
|
60
|
-
* **`rushdeploy project <slug> start|stop|redeploy`**: Control container run state.
|
|
61
|
-
* **`rushdeploy project <slug> rollback [deployment_id]`**: Rollback project to a previous deployment build.
|
|
62
|
-
* **`rushdeploy project <slug> visit`**: Open the project's URL in your default browser.
|
|
63
|
-
* **`rushdeploy project <slug> stats`**: Stream container CPU & RAM telemetry.
|
|
64
|
-
* **`rushdeploy project <slug> logs`**: Tail container build and running output.
|
|
65
|
-
* *Options: `--lines <N>`*
|
|
66
|
-
* **`rushdeploy project <slug> env [set|remove]`**: Configure environment variables.
|
|
67
|
-
* **`rushdeploy project <slug> autoscale`**: Read/write auto-scaling replica properties.
|
|
68
|
-
* **`rushdeploy project <slug> autodeploy <on|off>`**: Toggle webhook push deployments.
|
|
1
|
+
# RushDeploy CLI (Node.js Package)
|
|
2
|
+
|
|
3
|
+
A zero-dependency Node.js command-line utility to manage your self-hosted RushDeploy PaaS account.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install the package globally via npm:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g rushdeploy
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
### 1. Authenticate with your server
|
|
20
|
+
Generate a CLI token in Settings inside the Web Dashboard and log in:
|
|
21
|
+
```bash
|
|
22
|
+
rushdeploy login <token>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. Check Workspace Status
|
|
26
|
+
```bash
|
|
27
|
+
# Displays workspace resource quotas and allocations
|
|
28
|
+
rushdeploy status
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Deploy a project
|
|
32
|
+
Deploy a public Git repository:
|
|
33
|
+
```bash
|
|
34
|
+
rushdeploy deploy git https://github.com/my-username/my-react-app.git --branch main --type react
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Commands Reference
|
|
40
|
+
|
|
41
|
+
* **`rushdeploy login <token>`**: Authenticate CLI session.
|
|
42
|
+
* **`rushdeploy logout`**: Clear local auth details.
|
|
43
|
+
* **`rushdeploy whoami`**: View details of the active user profile.
|
|
44
|
+
* **`rushdeploy status`**: Render resource metrics cards.
|
|
45
|
+
* **`rushdeploy plans`**: Show plan pricing quotas.
|
|
46
|
+
* **`rushdeploy projects`**: List active projects.
|
|
47
|
+
* **`rushdeploy repos`**: List repos in connected GitHub profile.
|
|
48
|
+
* **`rushdeploy workspace`**: Display resource usage limits and quotas.
|
|
49
|
+
* **`rushdeploy help`**: Show the CLI help dialog.
|
|
50
|
+
|
|
51
|
+
### Deployments
|
|
52
|
+
* **`rushdeploy deploy git <url> [opts]`**: Trigger deployment from a Git clone URL.
|
|
53
|
+
* *Options: `--name <name>`, `--branch <branch>`, `--type <framework>`*
|
|
54
|
+
* **`rushdeploy deploy repo <owner/repo> [opts]`**: Trigger deployment from your connected GitHub account.
|
|
55
|
+
* *Options: `--name <name>`, `--branch <branch>`, `--type <framework>`*
|
|
56
|
+
* **`rushdeploy deploy wordpress <name> --email <e> [opts]`**: Provision a new WordPress site instance.
|
|
57
|
+
* *Options: `--title <title>`, `--user <user>`, `--password <pass>`*
|
|
58
|
+
|
|
59
|
+
### Project Control
|
|
60
|
+
* **`rushdeploy project <slug> start|stop|redeploy`**: Control container run state.
|
|
61
|
+
* **`rushdeploy project <slug> rollback [deployment_id]`**: Rollback project to a previous deployment build.
|
|
62
|
+
* **`rushdeploy project <slug> visit`**: Open the project's URL in your default browser.
|
|
63
|
+
* **`rushdeploy project <slug> stats`**: Stream container CPU & RAM telemetry.
|
|
64
|
+
* **`rushdeploy project <slug> logs`**: Tail container build and running output.
|
|
65
|
+
* *Options: `--lines <N>`*
|
|
66
|
+
* **`rushdeploy project <slug> env [set|remove]`**: Configure environment variables.
|
|
67
|
+
* **`rushdeploy project <slug> autoscale`**: Read/write auto-scaling replica properties.
|
|
68
|
+
* **`rushdeploy project <slug> autodeploy <on|off>`**: Toggle webhook push deployments.
|
package/bin/index.js
CHANGED
|
@@ -92,8 +92,8 @@ const ui = {
|
|
|
92
92
|
},
|
|
93
93
|
|
|
94
94
|
box(fields, options = {}) {
|
|
95
|
-
const fieldPairs = Array.isArray(fields)
|
|
96
|
-
? fields
|
|
95
|
+
const fieldPairs = Array.isArray(fields)
|
|
96
|
+
? fields
|
|
97
97
|
: Object.entries(fields).map(([label, value]) => ({ label, value }));
|
|
98
98
|
|
|
99
99
|
const labelWidth = 14;
|
|
@@ -110,7 +110,7 @@ const ui = {
|
|
|
110
110
|
const innerWidth = Math.max(options.minWidth || 66, leftIndent + labelWidth + gap + maxValLen + rightMargin);
|
|
111
111
|
|
|
112
112
|
const topBorder = `┌${'─'.repeat(innerWidth)}┐`;
|
|
113
|
-
const emptyRow
|
|
113
|
+
const emptyRow = `│${' '.repeat(innerWidth)}│`;
|
|
114
114
|
const bottomBorder = `└${'─'.repeat(innerWidth)}┘`;
|
|
115
115
|
|
|
116
116
|
console.log(`\n${colors.gray}${topBorder}${colors.reset}`);
|
|
@@ -255,7 +255,7 @@ function makeRequest(apiPath, method = 'GET', data = null) {
|
|
|
255
255
|
} else if (jsonResponse && jsonResponse.detail) {
|
|
256
256
|
errorMsg = typeof jsonResponse.detail === 'object' ? jsonResponse.detail.message : jsonResponse.detail;
|
|
257
257
|
}
|
|
258
|
-
|
|
258
|
+
|
|
259
259
|
if (res.statusCode === 401) {
|
|
260
260
|
ui.stepError(`Unauthorized (401). Your token may have expired or been revoked.`);
|
|
261
261
|
console.log(` Please log in again using: ${colors.green}rushdeploy login <token>${colors.reset}`);
|
|
@@ -345,16 +345,16 @@ function extractRepoName(url) {
|
|
|
345
345
|
async function cmdLogin(token, serverArg) {
|
|
346
346
|
const server = serverArg || getServerUrl();
|
|
347
347
|
ui.stepInfo(`Connecting to ${colors.brightWhite}${server}${colors.reset}...`);
|
|
348
|
-
|
|
348
|
+
|
|
349
349
|
saveConfig(server, token);
|
|
350
|
-
|
|
350
|
+
|
|
351
351
|
try {
|
|
352
352
|
ui.stepInfo(`Validating authentication token...`);
|
|
353
353
|
const res = await makeRequest('/auth/me');
|
|
354
354
|
if (res.success) {
|
|
355
355
|
const user = res.user;
|
|
356
356
|
ui.step(`Authentication successful!`);
|
|
357
|
-
|
|
357
|
+
|
|
358
358
|
ui.box([
|
|
359
359
|
{ label: 'Account', value: `${colors.bold}${user.name}${colors.reset} (${colors.gray}${user.email}${colors.reset})` },
|
|
360
360
|
{ label: 'Role', value: user.role.toUpperCase() },
|
|
@@ -421,7 +421,7 @@ async function cmdPlans() {
|
|
|
421
421
|
function drawCards(cards, cardsPerRow = 2) {
|
|
422
422
|
const cardWidth = 34;
|
|
423
423
|
const rows = [];
|
|
424
|
-
|
|
424
|
+
|
|
425
425
|
for (let i = 0; i < cards.length; i += cardsPerRow) {
|
|
426
426
|
rows.push(cards.slice(i, i + cardsPerRow));
|
|
427
427
|
}
|
|
@@ -440,19 +440,19 @@ function drawCards(cards, cardsPerRow = 2) {
|
|
|
440
440
|
|
|
441
441
|
const label = card.label || '';
|
|
442
442
|
let value = card.value !== undefined ? String(card.value) : '';
|
|
443
|
-
|
|
443
|
+
|
|
444
444
|
let valColor = colors.bold;
|
|
445
445
|
if (card.status === 'online') valColor = colors.green + colors.bold;
|
|
446
446
|
else if (card.status === 'offline') valColor = colors.red + colors.bold;
|
|
447
447
|
else if (card.status === 'warn') valColor = colors.yellow + colors.bold;
|
|
448
|
-
|
|
448
|
+
|
|
449
449
|
const valStr = `${valColor}${value}${colors.reset}`;
|
|
450
450
|
const rawVal = stripAnsi(value);
|
|
451
|
-
|
|
451
|
+
|
|
452
452
|
const textLen = label.length + rawVal.length;
|
|
453
453
|
const padLen = cardWidth - 6 - textLen;
|
|
454
454
|
const pad = ' '.repeat(Math.max(1, padLen));
|
|
455
|
-
|
|
455
|
+
|
|
456
456
|
labelValLine += space + `${colors.gray}│${colors.reset} ${colors.brightCyan}${label}${colors.reset}${pad}${valStr} ${colors.gray}│${colors.reset}`;
|
|
457
457
|
sepLine += space + colors.gray + '├' + '─'.repeat(cardWidth - 2) + '┤' + colors.reset;
|
|
458
458
|
|
|
@@ -460,7 +460,7 @@ function drawCards(cards, cardsPerRow = 2) {
|
|
|
460
460
|
const rawHint = stripAnsi(hint);
|
|
461
461
|
const hintPadLen = cardWidth - 6 - rawHint.length;
|
|
462
462
|
const hintPad = ' '.repeat(Math.max(0, hintPadLen));
|
|
463
|
-
|
|
463
|
+
|
|
464
464
|
hintLine += space + `${colors.gray}│${colors.reset} ${colors.gray}${hint}${colors.reset}${hintPad} ${colors.gray}│${colors.reset}`;
|
|
465
465
|
bottomBorder += space + colors.gray + '└' + '─'.repeat(cardWidth - 2) + '┘' + colors.reset;
|
|
466
466
|
});
|
|
@@ -499,7 +499,7 @@ async function cmdStatus() {
|
|
|
499
499
|
const byStatus = stats.projects_by_status || {};
|
|
500
500
|
const celery = stats.celery || {};
|
|
501
501
|
const workerOnline = (celery.workers ?? 0) > 0;
|
|
502
|
-
|
|
502
|
+
|
|
503
503
|
const activeBuildingProjects = (byStatus.building || byStatus.BUILDING || 0) + (byStatus.pending || byStatus.PENDING || 0);
|
|
504
504
|
const activeTasksCount = (celery.active && celery.active > 0) ? celery.active : activeBuildingProjects;
|
|
505
505
|
const pendingInQueue = stats.redis_queue_len ?? celery.queued ?? 0;
|
|
@@ -517,23 +517,23 @@ async function cmdStatus() {
|
|
|
517
517
|
const adminCards = [
|
|
518
518
|
{ label: 'Users', value: stats.users ?? 0, hint: 'Total registered users' },
|
|
519
519
|
{ label: 'Databases', value: stats.databases ?? 0, hint: 'Total workspace databases' },
|
|
520
|
-
{
|
|
521
|
-
label: 'Projects',
|
|
522
|
-
value: stats.projects ?? 0,
|
|
523
|
-
hint: `${colors.green}${runCount} run${colors.reset} · ${colors.yellow}${buildCount} build${colors.reset} · ${colors.red}${failCount} fail${colors.reset}`
|
|
520
|
+
{
|
|
521
|
+
label: 'Projects',
|
|
522
|
+
value: stats.projects ?? 0,
|
|
523
|
+
hint: `${colors.green}${runCount} run${colors.reset} · ${colors.yellow}${buildCount} build${colors.reset} · ${colors.red}${failCount} fail${colors.reset}`
|
|
524
524
|
},
|
|
525
|
-
{
|
|
526
|
-
label: 'App Containers',
|
|
527
|
-
value: stats.running_containers ?? 0,
|
|
525
|
+
{
|
|
526
|
+
label: 'App Containers',
|
|
527
|
+
value: stats.running_containers ?? 0,
|
|
528
528
|
status: stats.docker_available ? 'online' : 'offline',
|
|
529
529
|
hint: stats.docker_available ? 'Active running containers' : 'Engine offline'
|
|
530
530
|
},
|
|
531
531
|
{ label: 'CPU Usage', value: cpuVal, hint: 'Host CPU load' },
|
|
532
532
|
{ label: 'RAM Usage', value: ramVal, hint: 'Host memory allocation' },
|
|
533
533
|
{ label: 'Disk Usage', value: diskVal, hint: 'Host storage capacity' },
|
|
534
|
-
{
|
|
535
|
-
label: 'Task Queue',
|
|
536
|
-
value: workerOnline ? 'Online' : 'Offline',
|
|
534
|
+
{
|
|
535
|
+
label: 'Task Queue',
|
|
536
|
+
value: workerOnline ? 'Online' : 'Offline',
|
|
537
537
|
status: workerOnline ? 'online' : 'offline',
|
|
538
538
|
hint: `${activeTasksCount} active · ${pendingInQueue} pending`
|
|
539
539
|
}
|
|
@@ -785,42 +785,39 @@ async function cmdDeploy(type, args) {
|
|
|
785
785
|
const keyIdx = args.indexOf('--key');
|
|
786
786
|
if (keyIdx !== -1 && args[keyIdx + 1]) encryptionKey = args[keyIdx + 1];
|
|
787
787
|
|
|
788
|
-
let
|
|
789
|
-
|
|
790
|
-
|
|
788
|
+
let authUser = null;
|
|
789
|
+
const userIdx = args.indexOf('--auth-user');
|
|
790
|
+
if (userIdx !== -1 && args[userIdx + 1]) authUser = args[userIdx + 1];
|
|
791
791
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
basicAuthUser = args[authUserIdx + 1];
|
|
796
|
-
}
|
|
797
|
-
const authPassIdx = args.indexOf('--auth-pass');
|
|
798
|
-
if (authPassIdx !== -1 && args[authPassIdx + 1]) {
|
|
799
|
-
basicAuthActive = true;
|
|
800
|
-
basicAuthPass = args[authPassIdx + 1];
|
|
801
|
-
}
|
|
792
|
+
let authPass = null;
|
|
793
|
+
const passIdx = args.indexOf('--auth-pass');
|
|
794
|
+
if (passIdx !== -1 && args[passIdx + 1]) authPass = args[passIdx + 1];
|
|
802
795
|
|
|
803
796
|
ui.step(`Preparing n8n autonomous workflow environment for ${name}`);
|
|
804
|
-
ui.step(`Configuring persistent volume storage and container security`);
|
|
805
797
|
ui.step(`Queueing 1-click n8n instance deployment`);
|
|
806
798
|
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
basic_auth_active
|
|
811
|
-
basic_auth_user
|
|
812
|
-
basic_auth_password
|
|
813
|
-
}
|
|
799
|
+
const payload = { name };
|
|
800
|
+
if (encryptionKey) payload.encryption_key = encryptionKey;
|
|
801
|
+
if (authUser || authPass) {
|
|
802
|
+
payload.basic_auth_active = true;
|
|
803
|
+
if (authUser) payload.basic_auth_user = authUser;
|
|
804
|
+
if (authPass) payload.basic_auth_password = authPass;
|
|
805
|
+
}
|
|
814
806
|
|
|
807
|
+
const res = await makeRequest('/projects/n8n', 'POST', payload);
|
|
815
808
|
if (res.success) {
|
|
816
809
|
ui.step(`n8n deployment queued successfully!`);
|
|
817
|
-
|
|
818
|
-
{ label: '
|
|
810
|
+
const n8nFields = [
|
|
811
|
+
{ label: 'Instance', value: colors.bold + name + colors.reset },
|
|
819
812
|
{ label: 'State', value: ui.badge('QUEUED') },
|
|
820
813
|
{ label: 'Project ID', value: String(res.project_id) },
|
|
821
814
|
{ label: 'Deployment ID', value: String(res.deployment_id) },
|
|
822
815
|
{ label: 'Public URL', value: colors.brightCyan + colors.bold + res.url + colors.reset }
|
|
823
|
-
]
|
|
816
|
+
];
|
|
817
|
+
if (res.encryption_key) {
|
|
818
|
+
n8nFields.push({ label: 'Encryption Key', value: res.encryption_key });
|
|
819
|
+
}
|
|
820
|
+
ui.box(n8nFields);
|
|
824
821
|
}
|
|
825
822
|
|
|
826
823
|
} else {
|
|
@@ -834,19 +831,18 @@ async function cmdDeploy(type, args) {
|
|
|
834
831
|
}
|
|
835
832
|
}
|
|
836
833
|
|
|
837
|
-
|
|
838
834
|
async function resolveProjectId(idOrSlug) {
|
|
839
835
|
if (/^\d+$/.test(idOrSlug)) {
|
|
840
836
|
return parseInt(idOrSlug, 10);
|
|
841
837
|
}
|
|
842
|
-
|
|
838
|
+
|
|
843
839
|
const res = await makeRequest('/projects/');
|
|
844
840
|
const projects = res.projects || [];
|
|
845
841
|
const matched = projects.find(p => p.slug === idOrSlug || p.name.toLowerCase() === idOrSlug.toLowerCase());
|
|
846
842
|
if (matched) {
|
|
847
843
|
return matched.id;
|
|
848
844
|
}
|
|
849
|
-
|
|
845
|
+
|
|
850
846
|
ui.stepError(`No project found matching name or slug "${idOrSlug}".`);
|
|
851
847
|
process.exit(1);
|
|
852
848
|
}
|
|
@@ -916,7 +912,7 @@ async function cmdProject(idOrSlug, subcommand, subArgs) {
|
|
|
916
912
|
const stats = statsRes.stats;
|
|
917
913
|
|
|
918
914
|
ui.stepInfo(`Resource metrics for Project ${id}`);
|
|
919
|
-
|
|
915
|
+
|
|
920
916
|
const fields = [
|
|
921
917
|
{ label: 'Current Status', value: ui.badge(info.status) }
|
|
922
918
|
];
|
|
@@ -1197,7 +1193,7 @@ async function cmdWorkspace() {
|
|
|
1197
1193
|
|
|
1198
1194
|
function printHelp() {
|
|
1199
1195
|
console.log(`
|
|
1200
|
-
${colors.bold}${colors.brightWhite}RushDeploy CLI${colors.reset} ${colors.gray}v1.0.
|
|
1196
|
+
${colors.bold}${colors.brightWhite}RushDeploy CLI${colors.reset} ${colors.gray}v1.0.9${colors.reset} - Modern PaaS Command Line Interface
|
|
1201
1197
|
|
|
1202
1198
|
${colors.bold}USAGE:${colors.reset}
|
|
1203
1199
|
${colors.brightCyan}rushdeploy${colors.reset} <command> [arguments] [options]
|
|
@@ -1220,6 +1216,8 @@ ${colors.bold}DEPLOYMENT COMMANDS:${colors.reset}
|
|
|
1220
1216
|
Options: ${colors.gray}--name <name> --branch <branch> --type <type>${colors.reset}
|
|
1221
1217
|
${colors.green}deploy wordpress <name>${colors.reset} Deploy a new one-click WordPress site
|
|
1222
1218
|
Options: ${colors.gray}--email <e> [--title <t>] [--user <u>] [--password <p>]${colors.reset}
|
|
1219
|
+
${colors.green}deploy n8n <name>${colors.reset} Deploy a 1-click n8n workflow engine
|
|
1220
|
+
Options: ${colors.gray}[--key <key>] [--auth-user <u>] [--auth-pass <p>]${colors.reset}
|
|
1223
1221
|
|
|
1224
1222
|
${colors.bold}PROJECT CONTROL:${colors.reset}
|
|
1225
1223
|
${colors.green}project <slug|id>${colors.reset} Show project overview
|
|
@@ -1251,11 +1249,6 @@ async function main() {
|
|
|
1251
1249
|
process.exit(0);
|
|
1252
1250
|
}
|
|
1253
1251
|
|
|
1254
|
-
if (command === 'version' || command === '-v' || command === '--version') {
|
|
1255
|
-
console.log(`${colors.bold}${colors.brightWhite}RushDeploy CLI${colors.reset} ${colors.gray}v1.0.7${colors.reset}`);
|
|
1256
|
-
process.exit(0);
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
1252
|
switch (command) {
|
|
1260
1253
|
case 'login': {
|
|
1261
1254
|
const token = args[1];
|
|
@@ -1264,13 +1257,13 @@ async function main() {
|
|
|
1264
1257
|
console.log(` Usage: ${colors.green}rushdeploy login <token> [--server <url>]${colors.reset}`);
|
|
1265
1258
|
process.exit(1);
|
|
1266
1259
|
}
|
|
1267
|
-
|
|
1260
|
+
|
|
1268
1261
|
let server = null;
|
|
1269
1262
|
const serverIndex = args.indexOf('--server');
|
|
1270
1263
|
if (serverIndex !== -1 && args[serverIndex + 1]) {
|
|
1271
1264
|
server = args[serverIndex + 1];
|
|
1272
1265
|
}
|
|
1273
|
-
|
|
1266
|
+
|
|
1274
1267
|
await cmdLogin(token, server);
|
|
1275
1268
|
break;
|
|
1276
1269
|
}
|
|
@@ -1287,7 +1280,6 @@ async function main() {
|
|
|
1287
1280
|
await cmdStatus();
|
|
1288
1281
|
break;
|
|
1289
1282
|
case 'projects':
|
|
1290
|
-
case 'ls':
|
|
1291
1283
|
await cmdProjects();
|
|
1292
1284
|
break;
|
|
1293
1285
|
case 'repos':
|
|
@@ -1299,68 +1291,6 @@ async function main() {
|
|
|
1299
1291
|
await cmdDeploy(type, deployArgs);
|
|
1300
1292
|
break;
|
|
1301
1293
|
}
|
|
1302
|
-
case 'open':
|
|
1303
|
-
case 'visit': {
|
|
1304
|
-
const target = args[1];
|
|
1305
|
-
if (!target) {
|
|
1306
|
-
ui.stepError(`Usage: rushdeploy open <slug|id>`);
|
|
1307
|
-
process.exit(1);
|
|
1308
|
-
}
|
|
1309
|
-
await cmdProject(target, 'visit', []);
|
|
1310
|
-
break;
|
|
1311
|
-
}
|
|
1312
|
-
case 'logs': {
|
|
1313
|
-
const target = args[1];
|
|
1314
|
-
if (!target) {
|
|
1315
|
-
ui.stepError(`Usage: rushdeploy logs <slug|id> [--lines <N>]`);
|
|
1316
|
-
process.exit(1);
|
|
1317
|
-
}
|
|
1318
|
-
await cmdProject(target, 'logs', args.slice(2));
|
|
1319
|
-
break;
|
|
1320
|
-
}
|
|
1321
|
-
case 'start': {
|
|
1322
|
-
const target = args[1];
|
|
1323
|
-
if (!target) {
|
|
1324
|
-
ui.stepError(`Usage: rushdeploy start <slug|id>`);
|
|
1325
|
-
process.exit(1);
|
|
1326
|
-
}
|
|
1327
|
-
await cmdProject(target, 'start', []);
|
|
1328
|
-
break;
|
|
1329
|
-
}
|
|
1330
|
-
case 'stop': {
|
|
1331
|
-
const target = args[1];
|
|
1332
|
-
if (!target) {
|
|
1333
|
-
ui.stepError(`Usage: rushdeploy stop <slug|id>`);
|
|
1334
|
-
process.exit(1);
|
|
1335
|
-
}
|
|
1336
|
-
await cmdProject(target, 'stop', []);
|
|
1337
|
-
break;
|
|
1338
|
-
}
|
|
1339
|
-
case 'restart':
|
|
1340
|
-
case 'redeploy': {
|
|
1341
|
-
const target = args[1];
|
|
1342
|
-
if (!target) {
|
|
1343
|
-
ui.stepError(`Usage: rushdeploy restart <slug|id>`);
|
|
1344
|
-
process.exit(1);
|
|
1345
|
-
}
|
|
1346
|
-
await cmdProject(target, 'redeploy', []);
|
|
1347
|
-
break;
|
|
1348
|
-
}
|
|
1349
|
-
case 'delete':
|
|
1350
|
-
case 'remove': {
|
|
1351
|
-
const target = args[1];
|
|
1352
|
-
if (!target) {
|
|
1353
|
-
ui.stepError(`Usage: rushdeploy delete <slug|id>`);
|
|
1354
|
-
process.exit(1);
|
|
1355
|
-
}
|
|
1356
|
-
const id = await resolveProjectId(target);
|
|
1357
|
-
ui.stepInfo(`Deleting project ${id}...`);
|
|
1358
|
-
const res = await makeRequest(`/projects/${id}`, 'DELETE');
|
|
1359
|
-
if (res.success) {
|
|
1360
|
-
ui.step(`Project deleted successfully.`);
|
|
1361
|
-
}
|
|
1362
|
-
break;
|
|
1363
|
-
}
|
|
1364
1294
|
case 'project': {
|
|
1365
1295
|
const idOrSlug = args[1];
|
|
1366
1296
|
if (!idOrSlug) {
|
|
@@ -1383,7 +1313,6 @@ async function main() {
|
|
|
1383
1313
|
}
|
|
1384
1314
|
}
|
|
1385
1315
|
|
|
1386
|
-
|
|
1387
1316
|
main().catch(err => {
|
|
1388
1317
|
ui.stepError(`Fatal Error: ${err.message}`);
|
|
1389
1318
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rushdeploy",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "CLI tool to manage your self-hosted RushDeploy PaaS account.",
|
|
5
|
-
"main": "bin/index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"rushdeploy": "bin/index.js"
|
|
8
|
-
},
|
|
9
|
-
"type": "commonjs",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"start": "node bin/index.js"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"rushdeploy",
|
|
15
|
-
"paas",
|
|
16
|
-
"cli"
|
|
17
|
-
],
|
|
18
|
-
"author": "RushDeploy Team",
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"files": [
|
|
21
|
-
"bin",
|
|
22
|
-
"README.md"
|
|
23
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "rushdeploy",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "CLI tool to manage your self-hosted RushDeploy PaaS account.",
|
|
5
|
+
"main": "bin/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"rushdeploy": "bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "commonjs",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node bin/index.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"rushdeploy",
|
|
15
|
+
"paas",
|
|
16
|
+
"cli"
|
|
17
|
+
],
|
|
18
|
+
"author": "RushDeploy Team",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"files": [
|
|
21
|
+
"bin",
|
|
22
|
+
"README.md"
|
|
23
|
+
]
|
|
24
24
|
}
|