-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpartial.js
More file actions
88 lines (72 loc) · 2.32 KB
/
Copy pathpartial.js
File metadata and controls
88 lines (72 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
var path = require('path');
var fs = require('fs-extra');
var sleepPromise = require('sleep-promise');
var CarolinaLib = require('./_carolina');
var config = require('./config');
async function partialDeploy(command, app) {
console.log(`Running command: ${command}`);
var Carolina = new CarolinaLib(config);
if (app) {
Carolina.allApps = [app];
console.log(`Using app ${app}`)
}
try {
if (command == 'gather-prerender-templates')
await Carolina.gatherPrerenderTemplates();
if (command == 'prerender')
await Carolina.doPrerender();
if (command == 'copy-docusaurus')
await Carolina.copyDocusaurus();
if (command == 'create-http-archives')
await Carolina.createHttpArchives();
if (command == 'create-svc-archives')
await Carolina.createSvcArchives();
if (command == 'create-tables')
await Carolina.createTables();
if (command == 'create-master-role')
await Carolina.createMasterRole();
if (command == 'add-policy')
await Carolina.addPolicyToMasterRole();
if (command == 'create-api')
await Carolina.createMasterAPI();
if (command == 'create-public-bucket') {
if (!Carolina.state.publicBucketExists) {
await Carolina.createPublicBucket();
var res = await Carolina.configurePublicBucket();
console.log(res);
}
}
if (command == 'create-private-bucket') {
if (!Carolina.state.privateBucketExists) {
await Carolina.createPrivateBucket();
}
}
if (command == 'fill-public-bucket')
await Carolina.fillPublicBucket();
if (command == 'fill-private-bucket')
await Carolina.fillPrivateBucket();
if (command == 'put-http')
await Carolina.putHttpPackages();
if (command == 'put-svc')
await Carolina.putSvcPackages();
if (command == 'create-endpoints')
await Carolina.createEndpoints();
if (command == 'deploy-api')
await Carolina.deployAPI();
if (command == 'write-frontend-config')
await Carolina.writeFrontEndConfigFile();
// console.log(Carolina.state);
if (command == 'put-state')
await Carolina.putState();
}
catch(err) {
console.log(err);
}
finally {
await Carolina.saveState();
}
}
if (process.argv[3])
partialDeploy(process.argv[2], process.argv[3])
else
partialDeploy(process.argv[2]);