@wocker/ws 1.0.25 → 1.0.27
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 +1 -1
- package/lib/AppModule.d.ts +0 -4
- package/lib/AppModule.js +44 -48
- package/lib/env.d.ts +2 -3
- package/lib/env.js +12 -42
- package/lib/main.d.ts +2 -3
- package/lib/main.js +23 -25
- package/lib/makes/GithubClient.d.ts +24 -3
- package/lib/makes/GithubClient.js +20 -6
- package/lib/makes/Version.d.ts +22 -0
- package/lib/makes/Version.js +59 -0
- package/lib/makes/VersionRange.d.ts +6 -0
- package/lib/makes/VersionRange.js +18 -0
- package/lib/makes/VersionRule.d.ts +24 -0
- package/lib/makes/VersionRule.js +68 -0
- package/lib/makes/index.d.ts +2 -0
- package/lib/makes/index.js +2 -0
- package/lib/modules/core/index.js +7 -26
- package/lib/modules/dns/controllers/DnsController.d.ts +7 -0
- package/lib/modules/dns/controllers/DnsController.js +47 -0
- package/lib/modules/dns/index.d.ts +4 -0
- package/lib/modules/dns/index.js +44 -0
- package/lib/modules/dns/services/DnsService.d.ts +10 -0
- package/lib/modules/dns/services/DnsService.js +77 -0
- package/lib/modules/index.d.ts +3 -1
- package/lib/modules/index.js +3 -1
- package/lib/modules/keystore/controllers/KeystoreController.d.ts +0 -3
- package/lib/modules/keystore/controllers/KeystoreController.js +3 -54
- package/lib/modules/keystore/services/KeystoreService.d.ts +1 -0
- package/lib/modules/keystore/services/KeystoreService.js +4 -0
- package/lib/modules/keystore/utils/createEncryptionKey.d.ts +1 -1
- package/lib/modules/package-manager/index.d.ts +5 -0
- package/lib/modules/package-manager/index.js +33 -0
- package/lib/modules/package-manager/providers/NpmProvider.d.ts +7 -0
- package/lib/modules/package-manager/providers/NpmProvider.js +39 -0
- package/lib/modules/package-manager/providers/PnpmProvider.d.ts +7 -0
- package/lib/modules/package-manager/providers/PnpmProvider.js +30 -0
- package/lib/modules/package-manager/providers/YarnProvider.d.ts +7 -0
- package/lib/modules/package-manager/providers/YarnProvider.js +29 -0
- package/lib/modules/package-manager/service/PackageManager.d.ts +10 -0
- package/lib/modules/package-manager/service/PackageManager.js +70 -0
- package/lib/modules/package-manager/service/RegistryService.d.ts +4 -0
- package/lib/{services/NpmService.js → modules/package-manager/service/RegistryService.js} +6 -11
- package/lib/modules/package-manager/types/Package.d.ts +4 -0
- package/lib/modules/package-manager/types/PackageManagerProvider.d.ts +6 -0
- package/lib/modules/package-manager/types/PackageManagerProvider.js +6 -0
- package/lib/{controllers → modules/plugin/controllers}/PluginController.d.ts +2 -2
- package/lib/{controllers → modules/plugin/controllers}/PluginController.js +21 -20
- package/lib/modules/plugin/index.d.ts +4 -0
- package/lib/modules/plugin/index.js +67 -0
- package/lib/{services → modules/plugin/services}/PluginService.d.ts +7 -5
- package/lib/{services → modules/plugin/services}/PluginService.js +38 -40
- package/lib/modules/preset/controllers/PresetController.d.ts +2 -2
- package/lib/modules/preset/controllers/PresetController.js +14 -8
- package/lib/modules/preset/controllers/PresetListener.d.ts +1 -1
- package/lib/modules/preset/controllers/PresetListener.js +2 -2
- package/lib/modules/preset/index.js +5 -2
- package/lib/modules/preset/repositories/PresetRepository.d.ts +3 -2
- package/lib/modules/preset/repositories/PresetRepository.js +9 -4
- package/lib/modules/preset/services/PresetService.d.ts +2 -1
- package/lib/modules/preset/services/PresetService.js +74 -14
- package/lib/modules/project/controllers/ProjectController.d.ts +37 -2
- package/lib/modules/project/controllers/ProjectController.js +837 -7
- package/lib/modules/project/controllers/SecretsController.d.ts +8 -0
- package/lib/modules/project/controllers/SecretsController.js +72 -0
- package/lib/modules/project/index.js +11 -4
- package/lib/modules/project/repositories/ProjectRepository.d.ts +3 -6
- package/lib/modules/project/repositories/ProjectRepository.js +9 -28
- package/lib/modules/project/services/ProjectService.d.ts +5 -3
- package/lib/modules/project/services/ProjectService.js +59 -4
- package/lib/modules/proxy/controllers/ProxyController.d.ts +1 -2
- package/lib/modules/proxy/controllers/ProxyController.js +1 -2
- package/lib/modules/proxy/index.js +5 -2
- package/lib/modules/proxy/services/CertService.d.ts +1 -1
- package/lib/modules/proxy/services/CertService.js +3 -3
- package/lib/modules/proxy/services/ProxyService.d.ts +2 -1
- package/lib/modules/proxy/services/ProxyService.js +7 -3
- package/lib/utils/exec.js +4 -1
- package/lib/utils/get-cursor-position.js +1 -1
- package/package.json +16 -15
- package/plugins/dns/Dockerfile +35 -0
- package/plugins/dns/app/Procfile +2 -0
- package/plugins/dns/app/dnsmasq.conf.tmpl +11 -0
- package/plugins/dns/app/dnsmasq.sh +28 -0
- package/plugins/proxmox/Dockerfile +35 -0
- package/plugins/proxy/Dockerfile +23 -0
- package/plugins/proxy/Procfile +2 -0
- package/plugins/proxy/bin/wocker-create-ca +19 -0
- package/plugins/proxy/bin/wocker-create-cert +38 -0
- package/plugins/proxy/bin/wocker-create-domains +21 -0
- package/presets/shopify/Dockerfile +160 -0
- package/presets/shopify/bin/compare-version +3 -0
- package/presets/shopify/config.json +26 -0
- package/presets/shopify/etc/apache2/apache2.conf +230 -0
- package/presets/shopify/etc/apache2/mods-available/mpm_prefork.conf +16 -0
- package/presets/shopify/etc/apache2/sites-available/000-default.conf +21 -0
- package/bin/ws.js +0 -6
- package/lib/controllers/ProjectController.d.ts +0 -44
- package/lib/controllers/ProjectController.js +0 -956
- package/lib/controllers/index.d.ts +0 -5
- package/lib/controllers/index.js +0 -21
- package/lib/modules/docker/index.d.ts +0 -9
- package/lib/modules/docker/index.js +0 -45
- package/lib/modules/docker/services/ComposeService.d.ts +0 -32
- package/lib/modules/docker/services/ComposeService.js +0 -129
- package/lib/modules/docker/services/ContainerService.d.ts +0 -14
- package/lib/modules/docker/services/ContainerService.js +0 -115
- package/lib/modules/docker/services/DockerService.d.ts +0 -31
- package/lib/modules/docker/services/DockerService.js +0 -246
- package/lib/modules/docker/services/ImageService.d.ts +0 -12
- package/lib/modules/docker/services/ImageService.js +0 -80
- package/lib/modules/docker/services/ModemService.d.ts +0 -16
- package/lib/modules/docker/services/ModemService.js +0 -157
- package/lib/modules/docker/services/ProtoService.d.ts +0 -6
- package/lib/modules/docker/services/ProtoService.js +0 -20
- package/lib/modules/docker/type/ComposeConfig.d.ts +0 -12
- package/lib/modules/docker/utils/formatSizeUnits.d.ts +0 -1
- package/lib/modules/docker/utils/formatSizeUnits.js +0 -19
- package/lib/services/NpmService.d.ts +0 -5
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +0 -17
- /package/lib/{controllers → modules/core/controllers}/CompletionController.d.ts +0 -0
- /package/lib/{controllers → modules/core/controllers}/CompletionController.js +0 -0
- /package/lib/{controllers → modules/core/controllers}/DebugController.d.ts +0 -0
- /package/lib/{controllers → modules/core/controllers}/DebugController.js +0 -0
- /package/lib/{controllers → modules/core/controllers}/ExperimentalController.d.ts +0 -0
- /package/lib/{controllers → modules/core/controllers}/ExperimentalController.js +0 -0
- /package/lib/modules/{docker/type/ComposeConfig.js → package-manager/types/Package.js} +0 -0
- /package/lib/{types → modules/package-manager/types}/PackageInfo.d.ts +0 -0
- /package/lib/{types → modules/package-manager/types}/PackageInfo.js +0 -0
|
@@ -1,956 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
-
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
-
};
|
|
44
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
-
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.ProjectController = void 0;
|
|
52
|
-
const core_1 = require("@wocker/core");
|
|
53
|
-
const utils_1 = require("@wocker/utils");
|
|
54
|
-
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
55
|
-
const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs"));
|
|
56
|
-
const Path = __importStar(require("path"));
|
|
57
|
-
const async_mutex_1 = require("async-mutex");
|
|
58
|
-
const docker_1 = require("../modules/docker");
|
|
59
|
-
const project_1 = require("../modules/project");
|
|
60
|
-
let ProjectController = class ProjectController {
|
|
61
|
-
constructor(appConfigService, processService, eventService, projectService, projectRepository, logService, dockerService) {
|
|
62
|
-
this.appConfigService = appConfigService;
|
|
63
|
-
this.processService = processService;
|
|
64
|
-
this.eventService = eventService;
|
|
65
|
-
this.projectService = projectService;
|
|
66
|
-
this.projectRepository = projectRepository;
|
|
67
|
-
this.logService = logService;
|
|
68
|
-
this.dockerService = dockerService;
|
|
69
|
-
}
|
|
70
|
-
async getProjectNames() {
|
|
71
|
-
const projects = this.projectRepository.search();
|
|
72
|
-
return projects.map((project) => {
|
|
73
|
-
return project.name;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
async getScriptNames() {
|
|
77
|
-
try {
|
|
78
|
-
const project = this.projectService.get();
|
|
79
|
-
return Object.keys(project.scripts);
|
|
80
|
-
}
|
|
81
|
-
catch (err) {
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
async init(name, type) {
|
|
86
|
-
const fs = new core_1.FileSystem(this.processService.pwd());
|
|
87
|
-
let project = this.projectRepository.searchOne({
|
|
88
|
-
path: fs.path()
|
|
89
|
-
});
|
|
90
|
-
if (!project) {
|
|
91
|
-
project = this.projectRepository.fromObject({
|
|
92
|
-
path: fs.path()
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
project.path = fs.path();
|
|
96
|
-
if (name) {
|
|
97
|
-
project.name = name;
|
|
98
|
-
}
|
|
99
|
-
if (!name || !project.name) {
|
|
100
|
-
project.name = await (0, utils_1.promptInput)({
|
|
101
|
-
required: "Project name is required",
|
|
102
|
-
message: "Project name",
|
|
103
|
-
type: "text",
|
|
104
|
-
default: project.name || Path.basename(project.path),
|
|
105
|
-
validate: (name) => {
|
|
106
|
-
if (typeof name !== "string") {
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
const otherProject = this.projectRepository.searchOne({
|
|
110
|
-
name
|
|
111
|
-
});
|
|
112
|
-
if (otherProject && otherProject.path !== project.path) {
|
|
113
|
-
return `Project "${name}" already exists`;
|
|
114
|
-
}
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
project.addDomain(project.containerName);
|
|
119
|
-
}
|
|
120
|
-
if (type) {
|
|
121
|
-
project.type = type;
|
|
122
|
-
}
|
|
123
|
-
const mapTypes = this.appConfigService.getProjectTypes();
|
|
124
|
-
if (!type || !project.type || !mapTypes[project.type]) {
|
|
125
|
-
project.type = await (0, utils_1.promptSelect)({
|
|
126
|
-
message: "Project type",
|
|
127
|
-
required: true,
|
|
128
|
-
options: mapTypes,
|
|
129
|
-
default: project.type
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
switch (project.type) {
|
|
133
|
-
case core_1.PROJECT_TYPE_DOCKERFILE: {
|
|
134
|
-
const files = fs.readdir();
|
|
135
|
-
const dockerfiles = files.filter((fileName) => {
|
|
136
|
-
if (new RegExp("^(.*)\\.dockerfile$").test(fileName)) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
return new RegExp("^Dockerfile(\\..*)?").test(fileName);
|
|
140
|
-
});
|
|
141
|
-
if (dockerfiles.length === 0) {
|
|
142
|
-
throw new Error("Dockerfiles not found");
|
|
143
|
-
}
|
|
144
|
-
project.dockerfile = await (0, utils_1.promptSelect)({
|
|
145
|
-
message: "Dockerfile",
|
|
146
|
-
required: true,
|
|
147
|
-
options: dockerfiles.map((dockerfile) => {
|
|
148
|
-
return {
|
|
149
|
-
value: dockerfile
|
|
150
|
-
};
|
|
151
|
-
}),
|
|
152
|
-
default: project.dockerfile
|
|
153
|
-
});
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
case core_1.PROJECT_TYPE_IMAGE: {
|
|
157
|
-
project.imageName = await (0, utils_1.promptInput)({
|
|
158
|
-
message: "Image name",
|
|
159
|
-
required: true,
|
|
160
|
-
default: project.imageName
|
|
161
|
-
});
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
case core_1.PROJECT_TYPE_COMPOSE: {
|
|
165
|
-
const composeFiles = fs.readdir().filter((file) => {
|
|
166
|
-
return /docker-compose\./.test(file);
|
|
167
|
-
});
|
|
168
|
-
if (composeFiles.length === 0) {
|
|
169
|
-
throw new Error("docker-compose files not found");
|
|
170
|
-
}
|
|
171
|
-
project.composefile = await (0, utils_1.promptSelect)({
|
|
172
|
-
message: "Docker compose",
|
|
173
|
-
required: true,
|
|
174
|
-
options: composeFiles,
|
|
175
|
-
default: project.composefile
|
|
176
|
-
});
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
case core_1.PROJECT_TYPE_PRESET:
|
|
180
|
-
break;
|
|
181
|
-
default:
|
|
182
|
-
throw new Error("Invalid project type");
|
|
183
|
-
}
|
|
184
|
-
await this.eventService.emit("project:init", project);
|
|
185
|
-
project.save();
|
|
186
|
-
}
|
|
187
|
-
async destroy(name) {
|
|
188
|
-
const project = this.projectService.get(name);
|
|
189
|
-
await this.projectService.stop(project);
|
|
190
|
-
this.appConfigService.removeProject(project.id);
|
|
191
|
-
this.appConfigService.save();
|
|
192
|
-
this.appConfigService.fs.rm(`projects/${project.id}`, {
|
|
193
|
-
recursive: true
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
async projectList(all) {
|
|
197
|
-
const table = new cli_table3_1.default({
|
|
198
|
-
head: ["Name", "Type", "Status"],
|
|
199
|
-
colAligns: ["left", "center", "center"]
|
|
200
|
-
});
|
|
201
|
-
const projects = this.projectRepository.search();
|
|
202
|
-
for (const project of projects) {
|
|
203
|
-
const container = await this.dockerService.getContainer(project.containerName);
|
|
204
|
-
if (!container) {
|
|
205
|
-
if (all) {
|
|
206
|
-
table.push([project.name, project.type, "-"]);
|
|
207
|
-
}
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
const { State: { Status = "stopped" } = {} } = await container.inspect();
|
|
211
|
-
table.push([project.name, project.type, Status]);
|
|
212
|
-
}
|
|
213
|
-
return table.toString();
|
|
214
|
-
}
|
|
215
|
-
async domains(name) {
|
|
216
|
-
const project = this.projectService.get(name);
|
|
217
|
-
const table = new cli_table3_1.default({
|
|
218
|
-
head: [yoctocolors_cjs_1.default.yellow("Domain")]
|
|
219
|
-
});
|
|
220
|
-
for (const domain of project.domains) {
|
|
221
|
-
table.push([domain]);
|
|
222
|
-
}
|
|
223
|
-
return table.toString();
|
|
224
|
-
}
|
|
225
|
-
async addDomain(addDomains, name) {
|
|
226
|
-
const project = this.projectService.get(name);
|
|
227
|
-
for (const domain of addDomains) {
|
|
228
|
-
project.addDomain(domain);
|
|
229
|
-
}
|
|
230
|
-
project.save();
|
|
231
|
-
}
|
|
232
|
-
async setDomains(domains, name) {
|
|
233
|
-
const project = this.projectService.get(name);
|
|
234
|
-
project.clearDomains();
|
|
235
|
-
for (const domain of domains) {
|
|
236
|
-
project.addDomain(domain);
|
|
237
|
-
}
|
|
238
|
-
project.save();
|
|
239
|
-
}
|
|
240
|
-
async removeDomain(removeDomains, name) {
|
|
241
|
-
const project = this.projectService.get(name);
|
|
242
|
-
for (const domain of removeDomains) {
|
|
243
|
-
project.removeDomain(domain);
|
|
244
|
-
}
|
|
245
|
-
project.save();
|
|
246
|
-
}
|
|
247
|
-
async clearDomain(name) {
|
|
248
|
-
const project = this.projectService.get(name);
|
|
249
|
-
project.clearDomains();
|
|
250
|
-
project.save();
|
|
251
|
-
}
|
|
252
|
-
async ports(name) {
|
|
253
|
-
const project = this.projectService.get(name);
|
|
254
|
-
const table = new cli_table3_1.default({
|
|
255
|
-
head: ["Ports"]
|
|
256
|
-
});
|
|
257
|
-
for (const port of project.ports || []) {
|
|
258
|
-
table.push([port]);
|
|
259
|
-
}
|
|
260
|
-
return table.toString();
|
|
261
|
-
}
|
|
262
|
-
async addPort(hostPort, containerPort, name) {
|
|
263
|
-
const project = this.projectService.get(name);
|
|
264
|
-
project.linkPort(parseInt(hostPort), parseInt(containerPort));
|
|
265
|
-
project.save();
|
|
266
|
-
}
|
|
267
|
-
async removePort(hostPort, containerPort, name) {
|
|
268
|
-
const project = this.projectService.get(name);
|
|
269
|
-
project.unlinkPort(parseInt(hostPort), parseInt(containerPort));
|
|
270
|
-
project.save();
|
|
271
|
-
}
|
|
272
|
-
async clearPorts(name) {
|
|
273
|
-
const project = this.projectService.get(name);
|
|
274
|
-
if (project.ports) {
|
|
275
|
-
delete project.ports;
|
|
276
|
-
project.save();
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
async configList(name, global) {
|
|
280
|
-
let env;
|
|
281
|
-
if (!global) {
|
|
282
|
-
const project = this.projectService.get(name);
|
|
283
|
-
env = project.env || {};
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
const config = this.appConfigService.config;
|
|
287
|
-
env = config.env || {};
|
|
288
|
-
}
|
|
289
|
-
const table = new cli_table3_1.default({
|
|
290
|
-
head: ["KEY", "VALUE"]
|
|
291
|
-
});
|
|
292
|
-
for (const i in env) {
|
|
293
|
-
table.push([i, env[i]]);
|
|
294
|
-
}
|
|
295
|
-
return table.toString();
|
|
296
|
-
}
|
|
297
|
-
async configGet(keys, name, global) {
|
|
298
|
-
let config = global
|
|
299
|
-
? this.appConfigService.config
|
|
300
|
-
: this.projectService.get(name);
|
|
301
|
-
const table = new cli_table3_1.default({
|
|
302
|
-
head: ["KEY", "VALUE"]
|
|
303
|
-
});
|
|
304
|
-
for (const key of keys) {
|
|
305
|
-
const value = config.getEnv(key, "");
|
|
306
|
-
if (!value) {
|
|
307
|
-
continue;
|
|
308
|
-
}
|
|
309
|
-
table.push([key, value]);
|
|
310
|
-
}
|
|
311
|
-
return table.toString();
|
|
312
|
-
}
|
|
313
|
-
async configSet(variables, name, global) {
|
|
314
|
-
if (global) {
|
|
315
|
-
for (const variable of variables) {
|
|
316
|
-
const [key, value] = variable.split("=");
|
|
317
|
-
if (!value) {
|
|
318
|
-
console.info(yoctocolors_cjs_1.default.yellow(`No value for "${key}"`));
|
|
319
|
-
continue;
|
|
320
|
-
}
|
|
321
|
-
this.appConfigService.config.setEnv(key.trim(), value.trim());
|
|
322
|
-
}
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
const project = this.projectService.get(name);
|
|
326
|
-
for (const variable of variables) {
|
|
327
|
-
const [key, value] = variable.split("=");
|
|
328
|
-
if (!value) {
|
|
329
|
-
console.info(yoctocolors_cjs_1.default.yellow(`No value for "${key}"`));
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
project.setEnv(key, value);
|
|
333
|
-
}
|
|
334
|
-
project.save();
|
|
335
|
-
}
|
|
336
|
-
async configUnset(configs, name, global) {
|
|
337
|
-
const env = configs.reduce((env, config) => {
|
|
338
|
-
const [key] = config.split("=");
|
|
339
|
-
env[key.trim()] = null;
|
|
340
|
-
return env;
|
|
341
|
-
}, {});
|
|
342
|
-
if (global) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const project = this.projectService.get(name);
|
|
346
|
-
for (const i in env) {
|
|
347
|
-
project.unsetEnv(i);
|
|
348
|
-
}
|
|
349
|
-
project.save();
|
|
350
|
-
}
|
|
351
|
-
async buildArgsList(name) {
|
|
352
|
-
const project = this.projectService.get(name);
|
|
353
|
-
const table = new cli_table3_1.default({
|
|
354
|
-
head: ["KEY", "VALUE"]
|
|
355
|
-
});
|
|
356
|
-
const buildArgs = project.buildArgs || {};
|
|
357
|
-
for (const i in buildArgs) {
|
|
358
|
-
table.push([i, typeof buildArgs[i] === "string" ? buildArgs[i] : JSON.stringify(buildArgs[i])]);
|
|
359
|
-
}
|
|
360
|
-
return table.toString();
|
|
361
|
-
}
|
|
362
|
-
async buildArgsGet(args, name) {
|
|
363
|
-
const project = this.projectService.get(name);
|
|
364
|
-
const table = new cli_table3_1.default({
|
|
365
|
-
head: ["KEY", "VALUE"]
|
|
366
|
-
});
|
|
367
|
-
for (const key of args) {
|
|
368
|
-
if (project.buildArgs && typeof project.buildArgs[key] !== "undefined") {
|
|
369
|
-
const value = project.buildArgs[key] || "";
|
|
370
|
-
table.push([key, value]);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return table.toString();
|
|
374
|
-
}
|
|
375
|
-
async buildArgsSet(args, name) {
|
|
376
|
-
const project = this.projectService.get(name);
|
|
377
|
-
const buildArgs = args.reduce((env, config) => {
|
|
378
|
-
let [, key = "", value = ""] = config.split(/^([^=]+)=(.*)$/);
|
|
379
|
-
key = key.trim();
|
|
380
|
-
value = value.trim();
|
|
381
|
-
if (key) {
|
|
382
|
-
env[key] = value;
|
|
383
|
-
}
|
|
384
|
-
return env;
|
|
385
|
-
}, {});
|
|
386
|
-
for (const key in buildArgs) {
|
|
387
|
-
if (!project.buildArgs) {
|
|
388
|
-
project.buildArgs = {};
|
|
389
|
-
}
|
|
390
|
-
project.buildArgs[key] = buildArgs[key];
|
|
391
|
-
}
|
|
392
|
-
project.save();
|
|
393
|
-
}
|
|
394
|
-
async buildArgsUnset(args, name) {
|
|
395
|
-
const project = this.projectService.get(name);
|
|
396
|
-
const buildArgs = args.reduce((env, config) => {
|
|
397
|
-
let [, key = "", value = ""] = config.split(/^([^=]+)(?:=(.*))?$/);
|
|
398
|
-
key = key.trim();
|
|
399
|
-
value = value.trim();
|
|
400
|
-
env[key] = value;
|
|
401
|
-
return env;
|
|
402
|
-
}, {});
|
|
403
|
-
for (const key in buildArgs) {
|
|
404
|
-
if (!project.buildArgs) {
|
|
405
|
-
break;
|
|
406
|
-
}
|
|
407
|
-
if (typeof project.buildArgs[key] !== "undefined") {
|
|
408
|
-
delete project.buildArgs[key];
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
project.save();
|
|
412
|
-
}
|
|
413
|
-
async volumeList(name) {
|
|
414
|
-
const project = this.projectService.get(name);
|
|
415
|
-
const table = new cli_table3_1.default({
|
|
416
|
-
head: ["Volume"]
|
|
417
|
-
});
|
|
418
|
-
const volumes = project.volumes || [];
|
|
419
|
-
for (const volume of volumes) {
|
|
420
|
-
table.push([volume]);
|
|
421
|
-
}
|
|
422
|
-
return table.toString();
|
|
423
|
-
}
|
|
424
|
-
async volumeMount(volumes, name) {
|
|
425
|
-
const project = this.projectService.get(name);
|
|
426
|
-
if (Array.isArray(volumes) && volumes.length > 0) {
|
|
427
|
-
project.volumeMount(...volumes);
|
|
428
|
-
project.save();
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
async volumeUnmount(volumes, name) {
|
|
432
|
-
const project = this.projectService.get(name);
|
|
433
|
-
if (Array.isArray(volumes) && volumes.length > 0) {
|
|
434
|
-
project.volumeUnmount(...volumes);
|
|
435
|
-
project.save();
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
async extraHostList(name) {
|
|
439
|
-
const project = this.projectService.get(name);
|
|
440
|
-
if (!project.extraHosts) {
|
|
441
|
-
return "No extra hosts found";
|
|
442
|
-
}
|
|
443
|
-
const table = new cli_table3_1.default({
|
|
444
|
-
head: ["Host", "Domain"]
|
|
445
|
-
});
|
|
446
|
-
for (const host in project.extraHosts) {
|
|
447
|
-
table.push([
|
|
448
|
-
host, project.extraHosts[host]
|
|
449
|
-
]);
|
|
450
|
-
}
|
|
451
|
-
return table.toString();
|
|
452
|
-
}
|
|
453
|
-
async addExtraHost(extraHost, extraDomain, name) {
|
|
454
|
-
const project = this.projectService.get(name);
|
|
455
|
-
project.addExtraHost(extraHost, extraDomain);
|
|
456
|
-
project.save();
|
|
457
|
-
}
|
|
458
|
-
async removeExtraHost(extraHost, name) {
|
|
459
|
-
const project = this.projectService.get(name);
|
|
460
|
-
project.removeExtraHost(extraHost);
|
|
461
|
-
project.save();
|
|
462
|
-
}
|
|
463
|
-
async attach(name) {
|
|
464
|
-
const project = this.projectService.get(name);
|
|
465
|
-
await this.dockerService.attach(project.containerName);
|
|
466
|
-
}
|
|
467
|
-
async run(script, args, name) {
|
|
468
|
-
const project = this.projectService.get(name);
|
|
469
|
-
if (!project.scripts || !project.scripts[script]) {
|
|
470
|
-
throw new Error(`Script ${script} not found`);
|
|
471
|
-
}
|
|
472
|
-
const container = await this.dockerService.getContainer(project.containerName);
|
|
473
|
-
if (!container) {
|
|
474
|
-
throw new Error("The project is not started");
|
|
475
|
-
}
|
|
476
|
-
const exec = await container.exec({
|
|
477
|
-
AttachStdin: true,
|
|
478
|
-
AttachStdout: true,
|
|
479
|
-
AttachStderr: true,
|
|
480
|
-
Tty: process.stdin.isTTY,
|
|
481
|
-
Cmd: ["bash", "-i", "-c", [project.scripts[script], ...args || []].join(" ")]
|
|
482
|
-
});
|
|
483
|
-
const stream = await exec.start({
|
|
484
|
-
hijack: true,
|
|
485
|
-
stdin: true,
|
|
486
|
-
Tty: process.stdin.isTTY
|
|
487
|
-
});
|
|
488
|
-
await this.dockerService.attachStream(stream);
|
|
489
|
-
}
|
|
490
|
-
async logs(name, global, detach, follow, clear) {
|
|
491
|
-
if (global) {
|
|
492
|
-
if (clear) {
|
|
493
|
-
this.logService.clear();
|
|
494
|
-
}
|
|
495
|
-
const prepareLog = (str) => {
|
|
496
|
-
return str.replace(/^\[.*]\s([^:]+):\s.*$/gm, (substring, type) => {
|
|
497
|
-
switch (type) {
|
|
498
|
-
case "debug":
|
|
499
|
-
return yoctocolors_cjs_1.default.gray(substring);
|
|
500
|
-
case "log":
|
|
501
|
-
return yoctocolors_cjs_1.default.white(substring);
|
|
502
|
-
case "info":
|
|
503
|
-
return yoctocolors_cjs_1.default.green(substring);
|
|
504
|
-
case "warn":
|
|
505
|
-
case "warning":
|
|
506
|
-
return yoctocolors_cjs_1.default.yellow(substring);
|
|
507
|
-
case "error":
|
|
508
|
-
return yoctocolors_cjs_1.default.red(substring);
|
|
509
|
-
default:
|
|
510
|
-
return substring;
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
};
|
|
514
|
-
const file = this.appConfigService.fs.open("ws.log", "r");
|
|
515
|
-
const stream = file.createReadlineStream({
|
|
516
|
-
start: -10
|
|
517
|
-
});
|
|
518
|
-
stream.on("data", (line) => {
|
|
519
|
-
process.stdout.write(prepareLog(line));
|
|
520
|
-
process.stdout.write("\n");
|
|
521
|
-
});
|
|
522
|
-
if (follow) {
|
|
523
|
-
const stats = file.stat();
|
|
524
|
-
const watcher = this.appConfigService.fs.watch("ws.log");
|
|
525
|
-
const mutex = new async_mutex_1.Mutex();
|
|
526
|
-
let position = stats.size;
|
|
527
|
-
watcher.on("change", async () => {
|
|
528
|
-
await mutex.acquire();
|
|
529
|
-
try {
|
|
530
|
-
const stats = file.stat();
|
|
531
|
-
if (stats.size < position) {
|
|
532
|
-
console.info("file truncated");
|
|
533
|
-
position = 0;
|
|
534
|
-
}
|
|
535
|
-
const buffer = file.readBytes(position);
|
|
536
|
-
position += buffer.length;
|
|
537
|
-
process.stdout.write(prepareLog(buffer.toString("utf-8")));
|
|
538
|
-
}
|
|
539
|
-
finally {
|
|
540
|
-
mutex.release();
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
const project = this.projectService.get(name);
|
|
547
|
-
await this.projectService.logs(project, detach);
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
|
-
exports.ProjectController = ProjectController;
|
|
551
|
-
__decorate([
|
|
552
|
-
(0, core_1.Completion)("name"),
|
|
553
|
-
__metadata("design:type", Function),
|
|
554
|
-
__metadata("design:paramtypes", []),
|
|
555
|
-
__metadata("design:returntype", Promise)
|
|
556
|
-
], ProjectController.prototype, "getProjectNames", null);
|
|
557
|
-
__decorate([
|
|
558
|
-
(0, core_1.Completion)("script"),
|
|
559
|
-
__metadata("design:type", Function),
|
|
560
|
-
__metadata("design:paramtypes", []),
|
|
561
|
-
__metadata("design:returntype", Promise)
|
|
562
|
-
], ProjectController.prototype, "getScriptNames", null);
|
|
563
|
-
__decorate([
|
|
564
|
-
(0, core_1.Command)("init"),
|
|
565
|
-
(0, core_1.Description)("Project initialisation"),
|
|
566
|
-
__param(0, (0, core_1.Option)("name", {
|
|
567
|
-
type: "string",
|
|
568
|
-
alias: "n",
|
|
569
|
-
description: "The name of the project"
|
|
570
|
-
})),
|
|
571
|
-
__param(1, (0, core_1.Option)("type", {
|
|
572
|
-
type: "string",
|
|
573
|
-
alias: "t",
|
|
574
|
-
description: "Project type"
|
|
575
|
-
})),
|
|
576
|
-
__metadata("design:type", Function),
|
|
577
|
-
__metadata("design:paramtypes", [String, String]),
|
|
578
|
-
__metadata("design:returntype", Promise)
|
|
579
|
-
], ProjectController.prototype, "init", null);
|
|
580
|
-
__decorate([
|
|
581
|
-
(0, core_1.Command)("destroy [name]"),
|
|
582
|
-
(0, core_1.Description)("Permanently destroy a project"),
|
|
583
|
-
__param(0, (0, core_1.Param)("name")),
|
|
584
|
-
__metadata("design:type", Function),
|
|
585
|
-
__metadata("design:paramtypes", [String]),
|
|
586
|
-
__metadata("design:returntype", Promise)
|
|
587
|
-
], ProjectController.prototype, "destroy", null);
|
|
588
|
-
__decorate([
|
|
589
|
-
(0, core_1.Command)("ps"),
|
|
590
|
-
(0, core_1.Description)("Projects list"),
|
|
591
|
-
__param(0, (0, core_1.Option)("all", {
|
|
592
|
-
type: "boolean",
|
|
593
|
-
alias: "a",
|
|
594
|
-
description: "All projects"
|
|
595
|
-
})),
|
|
596
|
-
__metadata("design:type", Function),
|
|
597
|
-
__metadata("design:paramtypes", [Boolean]),
|
|
598
|
-
__metadata("design:returntype", Promise)
|
|
599
|
-
], ProjectController.prototype, "projectList", null);
|
|
600
|
-
__decorate([
|
|
601
|
-
(0, core_1.Command)("domains"),
|
|
602
|
-
(0, core_1.Description)("Project domain list"),
|
|
603
|
-
__param(0, (0, core_1.Option)("name", {
|
|
604
|
-
type: "string",
|
|
605
|
-
alias: "n",
|
|
606
|
-
description: "The name of the project"
|
|
607
|
-
})),
|
|
608
|
-
__metadata("design:type", Function),
|
|
609
|
-
__metadata("design:paramtypes", [String]),
|
|
610
|
-
__metadata("design:returntype", Promise)
|
|
611
|
-
], ProjectController.prototype, "domains", null);
|
|
612
|
-
__decorate([
|
|
613
|
-
(0, core_1.Command)("domain:add [...domains]"),
|
|
614
|
-
(0, core_1.Description)("Adding project domain"),
|
|
615
|
-
__param(0, (0, core_1.Param)("domains")),
|
|
616
|
-
__param(1, (0, core_1.Option)("name", {
|
|
617
|
-
type: "string",
|
|
618
|
-
alias: "n",
|
|
619
|
-
description: "The name of the project"
|
|
620
|
-
})),
|
|
621
|
-
__metadata("design:type", Function),
|
|
622
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
623
|
-
__metadata("design:returntype", Promise)
|
|
624
|
-
], ProjectController.prototype, "addDomain", null);
|
|
625
|
-
__decorate([
|
|
626
|
-
(0, core_1.Command)("domain:set [...domains]"),
|
|
627
|
-
(0, core_1.Description)("Setting project domains"),
|
|
628
|
-
__param(0, (0, core_1.Param)("domains")),
|
|
629
|
-
__param(1, (0, core_1.Option)("name", {
|
|
630
|
-
type: "string",
|
|
631
|
-
alias: "n",
|
|
632
|
-
description: "Project name"
|
|
633
|
-
})),
|
|
634
|
-
__metadata("design:type", Function),
|
|
635
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
636
|
-
__metadata("design:returntype", Promise)
|
|
637
|
-
], ProjectController.prototype, "setDomains", null);
|
|
638
|
-
__decorate([
|
|
639
|
-
(0, core_1.Command)("domain:remove [...domains]"),
|
|
640
|
-
(0, core_1.Description)("Removing project domain"),
|
|
641
|
-
__param(0, (0, core_1.Param)("domains")),
|
|
642
|
-
__param(1, (0, core_1.Option)("name", {
|
|
643
|
-
type: "string",
|
|
644
|
-
alias: "n",
|
|
645
|
-
description: "The name of the project"
|
|
646
|
-
})),
|
|
647
|
-
__metadata("design:type", Function),
|
|
648
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
649
|
-
__metadata("design:returntype", Promise)
|
|
650
|
-
], ProjectController.prototype, "removeDomain", null);
|
|
651
|
-
__decorate([
|
|
652
|
-
(0, core_1.Command)("domain:clear"),
|
|
653
|
-
(0, core_1.Description)("Clearing project domain"),
|
|
654
|
-
__param(0, (0, core_1.Option)("name", {
|
|
655
|
-
type: "string",
|
|
656
|
-
alias: "n",
|
|
657
|
-
description: "The name of the project"
|
|
658
|
-
})),
|
|
659
|
-
__metadata("design:type", Function),
|
|
660
|
-
__metadata("design:paramtypes", [String]),
|
|
661
|
-
__metadata("design:returntype", Promise)
|
|
662
|
-
], ProjectController.prototype, "clearDomain", null);
|
|
663
|
-
__decorate([
|
|
664
|
-
(0, core_1.Command)("ports"),
|
|
665
|
-
__param(0, (0, core_1.Option)("name", {
|
|
666
|
-
type: "string",
|
|
667
|
-
alias: "n",
|
|
668
|
-
description: "The name of the project"
|
|
669
|
-
})),
|
|
670
|
-
__metadata("design:type", Function),
|
|
671
|
-
__metadata("design:paramtypes", [String]),
|
|
672
|
-
__metadata("design:returntype", Promise)
|
|
673
|
-
], ProjectController.prototype, "ports", null);
|
|
674
|
-
__decorate([
|
|
675
|
-
(0, core_1.Command)("port:add <host-port>:<container-port>"),
|
|
676
|
-
__param(0, (0, core_1.Param)("host-port")),
|
|
677
|
-
__param(1, (0, core_1.Param)("container-port")),
|
|
678
|
-
__param(2, (0, core_1.Option)("name", {
|
|
679
|
-
type: "string",
|
|
680
|
-
alias: "n",
|
|
681
|
-
description: "The name of the project"
|
|
682
|
-
})),
|
|
683
|
-
__metadata("design:type", Function),
|
|
684
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
685
|
-
__metadata("design:returntype", Promise)
|
|
686
|
-
], ProjectController.prototype, "addPort", null);
|
|
687
|
-
__decorate([
|
|
688
|
-
(0, core_1.Command)("port:remove <host-port>:<container-port>"),
|
|
689
|
-
__param(0, (0, core_1.Param)("host-port")),
|
|
690
|
-
__param(1, (0, core_1.Param)("container-port")),
|
|
691
|
-
__param(2, (0, core_1.Option)("name", {
|
|
692
|
-
type: "string",
|
|
693
|
-
alias: "n",
|
|
694
|
-
description: "The name of the project"
|
|
695
|
-
})),
|
|
696
|
-
__metadata("design:type", Function),
|
|
697
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
698
|
-
__metadata("design:returntype", Promise)
|
|
699
|
-
], ProjectController.prototype, "removePort", null);
|
|
700
|
-
__decorate([
|
|
701
|
-
(0, core_1.Command)("port:clear"),
|
|
702
|
-
__param(0, (0, core_1.Option)("name", {
|
|
703
|
-
type: "string",
|
|
704
|
-
alias: "n",
|
|
705
|
-
description: "The name of the project"
|
|
706
|
-
})),
|
|
707
|
-
__metadata("design:type", Function),
|
|
708
|
-
__metadata("design:paramtypes", [String]),
|
|
709
|
-
__metadata("design:returntype", Promise)
|
|
710
|
-
], ProjectController.prototype, "clearPorts", null);
|
|
711
|
-
__decorate([
|
|
712
|
-
(0, core_1.Command)("config"),
|
|
713
|
-
__param(0, (0, core_1.Option)("name", {
|
|
714
|
-
type: "string",
|
|
715
|
-
alias: "n",
|
|
716
|
-
description: "The name of the project"
|
|
717
|
-
})),
|
|
718
|
-
__param(1, (0, core_1.Option)("global", {
|
|
719
|
-
type: "boolean",
|
|
720
|
-
alias: "g"
|
|
721
|
-
})),
|
|
722
|
-
__metadata("design:type", Function),
|
|
723
|
-
__metadata("design:paramtypes", [String, Boolean]),
|
|
724
|
-
__metadata("design:returntype", Promise)
|
|
725
|
-
], ProjectController.prototype, "configList", null);
|
|
726
|
-
__decorate([
|
|
727
|
-
(0, core_1.Command)("config:get [...key]"),
|
|
728
|
-
__param(0, (0, core_1.Param)("key")),
|
|
729
|
-
__param(1, (0, core_1.Option)("name", {
|
|
730
|
-
type: "string",
|
|
731
|
-
alias: "n",
|
|
732
|
-
description: "The name of the project"
|
|
733
|
-
})),
|
|
734
|
-
__param(2, (0, core_1.Option)("global", {
|
|
735
|
-
type: "boolean",
|
|
736
|
-
alias: "g"
|
|
737
|
-
})),
|
|
738
|
-
__metadata("design:type", Function),
|
|
739
|
-
__metadata("design:paramtypes", [Array, String, Boolean]),
|
|
740
|
-
__metadata("design:returntype", Promise)
|
|
741
|
-
], ProjectController.prototype, "configGet", null);
|
|
742
|
-
__decorate([
|
|
743
|
-
(0, core_1.Command)("config:set [...configs]"),
|
|
744
|
-
(0, core_1.Description)("Setting env variables"),
|
|
745
|
-
__param(0, (0, core_1.Param)("configs")),
|
|
746
|
-
__param(1, (0, core_1.Option)("name", {
|
|
747
|
-
type: "string",
|
|
748
|
-
alias: "n",
|
|
749
|
-
description: "The name of the project"
|
|
750
|
-
})),
|
|
751
|
-
__param(2, (0, core_1.Option)("global", {
|
|
752
|
-
type: "boolean",
|
|
753
|
-
alias: "g"
|
|
754
|
-
})),
|
|
755
|
-
__metadata("design:type", Function),
|
|
756
|
-
__metadata("design:paramtypes", [Array, String, Boolean]),
|
|
757
|
-
__metadata("design:returntype", Promise)
|
|
758
|
-
], ProjectController.prototype, "configSet", null);
|
|
759
|
-
__decorate([
|
|
760
|
-
(0, core_1.Command)("config:unset [...configs]"),
|
|
761
|
-
__param(0, (0, core_1.Param)("configs")),
|
|
762
|
-
__param(1, (0, core_1.Option)("name", {
|
|
763
|
-
type: "string",
|
|
764
|
-
alias: "n",
|
|
765
|
-
description: "The name of the project"
|
|
766
|
-
})),
|
|
767
|
-
__param(2, (0, core_1.Option)("global", {
|
|
768
|
-
type: "boolean",
|
|
769
|
-
alias: "g"
|
|
770
|
-
})),
|
|
771
|
-
__metadata("design:type", Function),
|
|
772
|
-
__metadata("design:paramtypes", [Array, String, Boolean]),
|
|
773
|
-
__metadata("design:returntype", Promise)
|
|
774
|
-
], ProjectController.prototype, "configUnset", null);
|
|
775
|
-
__decorate([
|
|
776
|
-
(0, core_1.Command)("build-args"),
|
|
777
|
-
__param(0, (0, core_1.Option)("name", {
|
|
778
|
-
type: "string",
|
|
779
|
-
alias: "n",
|
|
780
|
-
description: "The name of the project"
|
|
781
|
-
})),
|
|
782
|
-
__metadata("design:type", Function),
|
|
783
|
-
__metadata("design:paramtypes", [String]),
|
|
784
|
-
__metadata("design:returntype", Promise)
|
|
785
|
-
], ProjectController.prototype, "buildArgsList", null);
|
|
786
|
-
__decorate([
|
|
787
|
-
(0, core_1.Command)("build-args:get [...buildArgs]"),
|
|
788
|
-
__param(0, (0, core_1.Param)("buildArgs")),
|
|
789
|
-
__param(1, (0, core_1.Option)("name", {
|
|
790
|
-
type: "string",
|
|
791
|
-
alias: "n",
|
|
792
|
-
description: "The name of the project"
|
|
793
|
-
})),
|
|
794
|
-
__metadata("design:type", Function),
|
|
795
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
796
|
-
__metadata("design:returntype", Promise)
|
|
797
|
-
], ProjectController.prototype, "buildArgsGet", null);
|
|
798
|
-
__decorate([
|
|
799
|
-
(0, core_1.Command)("build-args:set [...buildArgs]"),
|
|
800
|
-
__param(0, (0, core_1.Param)("buildArgs")),
|
|
801
|
-
__param(1, (0, core_1.Option)("name", {
|
|
802
|
-
type: "string",
|
|
803
|
-
alias: "n",
|
|
804
|
-
description: "The name of the project"
|
|
805
|
-
})),
|
|
806
|
-
__metadata("design:type", Function),
|
|
807
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
808
|
-
__metadata("design:returntype", Promise)
|
|
809
|
-
], ProjectController.prototype, "buildArgsSet", null);
|
|
810
|
-
__decorate([
|
|
811
|
-
(0, core_1.Command)("build-args:unset [...buildArgs]"),
|
|
812
|
-
__param(0, (0, core_1.Param)("buildArgs")),
|
|
813
|
-
__param(1, (0, core_1.Option)("name", {
|
|
814
|
-
type: "string",
|
|
815
|
-
alias: "n",
|
|
816
|
-
description: "The name of the project"
|
|
817
|
-
})),
|
|
818
|
-
__metadata("design:type", Function),
|
|
819
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
820
|
-
__metadata("design:returntype", Promise)
|
|
821
|
-
], ProjectController.prototype, "buildArgsUnset", null);
|
|
822
|
-
__decorate([
|
|
823
|
-
(0, core_1.Command)("volumes"),
|
|
824
|
-
__param(0, (0, core_1.Option)("name", {
|
|
825
|
-
type: "string",
|
|
826
|
-
alias: "n",
|
|
827
|
-
description: "The name of the project"
|
|
828
|
-
})),
|
|
829
|
-
__metadata("design:type", Function),
|
|
830
|
-
__metadata("design:paramtypes", [String]),
|
|
831
|
-
__metadata("design:returntype", Promise)
|
|
832
|
-
], ProjectController.prototype, "volumeList", null);
|
|
833
|
-
__decorate([
|
|
834
|
-
(0, core_1.Command)("volume:mount [...volumes]"),
|
|
835
|
-
__param(0, (0, core_1.Param)("volumes")),
|
|
836
|
-
__param(1, (0, core_1.Option)("name", {
|
|
837
|
-
type: "string",
|
|
838
|
-
alias: "n",
|
|
839
|
-
description: "The name of the project"
|
|
840
|
-
})),
|
|
841
|
-
__metadata("design:type", Function),
|
|
842
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
843
|
-
__metadata("design:returntype", Promise)
|
|
844
|
-
], ProjectController.prototype, "volumeMount", null);
|
|
845
|
-
__decorate([
|
|
846
|
-
(0, core_1.Command)("volume:unmount [...volumes]"),
|
|
847
|
-
__param(0, (0, core_1.Param)("volumes")),
|
|
848
|
-
__param(1, (0, core_1.Option)("name", {
|
|
849
|
-
type: "string",
|
|
850
|
-
alias: "n",
|
|
851
|
-
description: "The name of the project"
|
|
852
|
-
})),
|
|
853
|
-
__metadata("design:type", Function),
|
|
854
|
-
__metadata("design:paramtypes", [Array, String]),
|
|
855
|
-
__metadata("design:returntype", Promise)
|
|
856
|
-
], ProjectController.prototype, "volumeUnmount", null);
|
|
857
|
-
__decorate([
|
|
858
|
-
(0, core_1.Command)("extra-hosts"),
|
|
859
|
-
(0, core_1.Description)("List of extra hosts"),
|
|
860
|
-
__param(0, (0, core_1.Option)("name", {
|
|
861
|
-
type: "string",
|
|
862
|
-
alias: "n",
|
|
863
|
-
description: "The name of the project"
|
|
864
|
-
})),
|
|
865
|
-
__metadata("design:type", Function),
|
|
866
|
-
__metadata("design:paramtypes", [String]),
|
|
867
|
-
__metadata("design:returntype", Promise)
|
|
868
|
-
], ProjectController.prototype, "extraHostList", null);
|
|
869
|
-
__decorate([
|
|
870
|
-
(0, core_1.Command)("extra-host:add <extraHost>:<extraDomain>"),
|
|
871
|
-
(0, core_1.Description)("Adding extra host"),
|
|
872
|
-
__param(0, (0, core_1.Param)("extraHost")),
|
|
873
|
-
__param(1, (0, core_1.Param)("extraDomain")),
|
|
874
|
-
__param(2, (0, core_1.Option)("name", {
|
|
875
|
-
type: "string",
|
|
876
|
-
alias: "n",
|
|
877
|
-
description: "The name of the project"
|
|
878
|
-
})),
|
|
879
|
-
__metadata("design:type", Function),
|
|
880
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
881
|
-
__metadata("design:returntype", Promise)
|
|
882
|
-
], ProjectController.prototype, "addExtraHost", null);
|
|
883
|
-
__decorate([
|
|
884
|
-
(0, core_1.Command)("extra-host:remove <extraHost>"),
|
|
885
|
-
(0, core_1.Description)("Removing extra host"),
|
|
886
|
-
__param(0, (0, core_1.Param)("extraHost")),
|
|
887
|
-
__param(1, (0, core_1.Option)("name", {
|
|
888
|
-
type: "string",
|
|
889
|
-
alias: "n",
|
|
890
|
-
description: "The name of the project"
|
|
891
|
-
})),
|
|
892
|
-
__metadata("design:type", Function),
|
|
893
|
-
__metadata("design:paramtypes", [String, String]),
|
|
894
|
-
__metadata("design:returntype", Promise)
|
|
895
|
-
], ProjectController.prototype, "removeExtraHost", null);
|
|
896
|
-
__decorate([
|
|
897
|
-
(0, core_1.Command)("attach"),
|
|
898
|
-
(0, core_1.Description)("Attach local standard input, output, and error streams to a running container"),
|
|
899
|
-
__param(0, (0, core_1.Option)("name", {
|
|
900
|
-
type: "string",
|
|
901
|
-
alias: "n",
|
|
902
|
-
description: "The name of the project"
|
|
903
|
-
})),
|
|
904
|
-
__metadata("design:type", Function),
|
|
905
|
-
__metadata("design:paramtypes", [String]),
|
|
906
|
-
__metadata("design:returntype", Promise)
|
|
907
|
-
], ProjectController.prototype, "attach", null);
|
|
908
|
-
__decorate([
|
|
909
|
-
(0, core_1.Command)("run <script> [...args]"),
|
|
910
|
-
__param(0, (0, core_1.Param)("script")),
|
|
911
|
-
__param(1, (0, core_1.Param)("args")),
|
|
912
|
-
__param(2, (0, core_1.Option)("name", {
|
|
913
|
-
type: "string",
|
|
914
|
-
alias: "n",
|
|
915
|
-
description: "The name of the project"
|
|
916
|
-
})),
|
|
917
|
-
__metadata("design:type", Function),
|
|
918
|
-
__metadata("design:paramtypes", [String, Array, String]),
|
|
919
|
-
__metadata("design:returntype", Promise)
|
|
920
|
-
], ProjectController.prototype, "run", null);
|
|
921
|
-
__decorate([
|
|
922
|
-
(0, core_1.Command)("logs"),
|
|
923
|
-
__param(0, (0, core_1.Option)("name", {
|
|
924
|
-
type: "string",
|
|
925
|
-
alias: "n",
|
|
926
|
-
description: "The name of the project"
|
|
927
|
-
})),
|
|
928
|
-
__param(1, (0, core_1.Option)("global", {
|
|
929
|
-
type: "boolean",
|
|
930
|
-
alias: "g"
|
|
931
|
-
})),
|
|
932
|
-
__param(2, (0, core_1.Option)("detach", {
|
|
933
|
-
type: "boolean",
|
|
934
|
-
alias: "d",
|
|
935
|
-
description: "Detach"
|
|
936
|
-
})),
|
|
937
|
-
__param(3, (0, core_1.Option)("follow", {
|
|
938
|
-
type: "boolean",
|
|
939
|
-
alias: "f"
|
|
940
|
-
})),
|
|
941
|
-
__param(4, (0, core_1.Option)("clear", "c")),
|
|
942
|
-
__metadata("design:type", Function),
|
|
943
|
-
__metadata("design:paramtypes", [String, Boolean, Boolean, Boolean, Boolean]),
|
|
944
|
-
__metadata("design:returntype", Promise)
|
|
945
|
-
], ProjectController.prototype, "logs", null);
|
|
946
|
-
exports.ProjectController = ProjectController = __decorate([
|
|
947
|
-
(0, core_1.Controller)(),
|
|
948
|
-
(0, core_1.Description)("Project commands"),
|
|
949
|
-
__metadata("design:paramtypes", [core_1.AppConfigService,
|
|
950
|
-
core_1.ProcessService,
|
|
951
|
-
core_1.EventService,
|
|
952
|
-
project_1.ProjectService,
|
|
953
|
-
project_1.ProjectRepository,
|
|
954
|
-
core_1.LogService,
|
|
955
|
-
docker_1.DockerService])
|
|
956
|
-
], ProjectController);
|