@catladder/cli 0.0.0-vars-07a720d0 → 0.0.0-waitfor-deploy-e64a33ba
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/dist/apps/catenv/catenv.d.ts +4 -1
- package/dist/apps/catenv/catenv.js +28 -20
- package/dist/apps/catenv/catenv.js.map +1 -1
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +24 -19
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +22 -14
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/apps/cli/commands/project/index.js +0 -2
- package/dist/apps/cli/commands/project/index.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js +1 -1
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/apps/cli/config/writeConfig.js +1 -4
- package/dist/apps/cli/config/writeConfig.js.map +1 -1
- package/dist/catenv.js +6 -1
- package/dist/catenv.js.map +1 -1
- package/dist/config/getProjectConfig.d.ts +3 -3
- package/dist/config/getProjectConfig.js +51 -23
- package/dist/config/getProjectConfig.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/gitlab.d.ts +1 -0
- package/dist/utils/gitlab.js +14 -1
- package/dist/utils/gitlab.js.map +1 -1
- package/package.json +2 -2
- package/src/apps/catenv/catenv.ts +14 -7
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +19 -6
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +20 -16
- package/src/apps/cli/commands/project/index.ts +0 -2
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +2 -2
- package/src/apps/cli/config/writeConfig.ts +0 -2
- package/src/catenv.ts +9 -2
- package/src/config/getProjectConfig.ts +43 -19
- package/src/utils/gitlab.ts +8 -0
- package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandReloadConfig.js +0 -62
- package/dist/apps/cli/commands/project/commandReloadConfig.js.map +0 -1
- package/src/apps/cli/commands/project/commandReloadConfig.ts +0 -12
package/dist/utils/gitlab.d.ts
CHANGED
|
@@ -17,5 +17,6 @@ declare type GitlabVariable = {
|
|
|
17
17
|
environment_scope: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const getAllVariables: ((vorpal: CommandInstance) => Promise<Array<GitlabVariable>>) & memoizee.Memoized<(vorpal: CommandInstance) => Promise<Array<GitlabVariable>>>;
|
|
20
|
+
export declare const getVariableValueByRawName: (vorpal: CommandInstance, rawName: string) => Promise<string>;
|
|
20
21
|
export declare const upsertAllVariables: (vorpal: CommandInstance, variables: Record<string, any>, env: string, componentName: string) => Promise<void>;
|
|
21
22
|
export {};
|
package/dist/utils/gitlab.js
CHANGED
|
@@ -48,7 +48,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
49
|
};
|
|
50
50
|
exports.__esModule = true;
|
|
51
|
-
exports.upsertAllVariables = exports.getAllVariables = exports.getProjectInfo = exports.doGitlabRequest = exports.getGitlabToken = exports.setupGitlabToken = exports.hasGitlabToken = void 0;
|
|
51
|
+
exports.upsertAllVariables = exports.getVariableValueByRawName = exports.getAllVariables = exports.getProjectInfo = exports.doGitlabRequest = exports.getGitlabToken = exports.setupGitlabToken = exports.hasGitlabToken = void 0;
|
|
52
52
|
var child_process_promise_1 = require("child-process-promise");
|
|
53
53
|
var pipeline_1 = require("@catladder/pipeline");
|
|
54
54
|
var lodash_1 = require("lodash");
|
|
@@ -199,6 +199,19 @@ exports.getAllVariables = (0, memoizee_1["default"])(function (vorpal) { return
|
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
}); }, { promise: true });
|
|
202
|
+
var getVariableValueByRawName = function (vorpal, rawName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
203
|
+
var allVariables;
|
|
204
|
+
var _a;
|
|
205
|
+
return __generator(this, function (_b) {
|
|
206
|
+
switch (_b.label) {
|
|
207
|
+
case 0: return [4 /*yield*/, (0, exports.getAllVariables)(vorpal)];
|
|
208
|
+
case 1:
|
|
209
|
+
allVariables = _b.sent();
|
|
210
|
+
return [2 /*return*/, (_a = allVariables.find(function (v) { return v.key === rawName; })) === null || _a === void 0 ? void 0 : _a.value];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}); };
|
|
214
|
+
exports.getVariableValueByRawName = getVariableValueByRawName;
|
|
202
215
|
var maskableRegex = new RegExp("^[a-zA-Z0-9_+=/@:.~-]{8,}$"); // SEE https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js#L20
|
|
203
216
|
var isMaskable = function (value) { return maskableRegex.test(value); };
|
|
204
217
|
var createVariable = function (vorpal, projectId, key, value) { return __awaiter(void 0, void 0, void 0, function () {
|
package/dist/utils/gitlab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../src/utils/gitlab.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,gDAAuD;AACvD,iCAAkC;AAClC,sDAAgC;AAChC,0DAA+B;AAC/B,8CAAwB;AAExB,6CAA4E;AAE5E,IAAM,SAAS,GAAG,8BAA8B,CAAC;AAE1C,IAAM,cAAc,GAAG;;gBAAY,qBAAM,IAAA,2BAAa,EAAC,SAAS,CAAC,EAAA;gBAA9B,sBAAA,SAA8B,EAAA;;SAAA,CAAC;AAA5D,QAAA,cAAc,kBAA8C;AAClE,IAAM,gBAAgB,GAAG,UAAO,MAAuB;;;;;gBAC5D,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACf,MAAM,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;gBAC5E,MAAM,CA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;gBAAzD,SAAyD,CAAC;;;gBAE1D,uBAAe,CAAC,KAAK,EAAE,CAAC;;;gBARD,IAA+B,CAAA;;;;;KAW3D,CAAC;AAnBW,QAAA,kBAAkB,sBAmB7B"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"catladder": "./bin/catladder"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@catladder/pipeline": "0.0.0-
|
|
19
|
+
"@catladder/pipeline": "0.0.0-waitfor-deploy-e64a33ba",
|
|
20
20
|
"@kubernetes/client-node": "^0.16.2",
|
|
21
21
|
"child-process-promise": "^2.2.1",
|
|
22
22
|
"command-exists-promise": "^2.0.2",
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"eslint": "^8.7.0",
|
|
56
56
|
"typescript": "^4.5.4"
|
|
57
57
|
},
|
|
58
|
-
"version": "0.0.0-
|
|
58
|
+
"version": "0.0.0-waitfor-deploy-e64a33ba",
|
|
59
59
|
"stableVersion": "0.0.0"
|
|
60
60
|
}
|
|
@@ -14,21 +14,29 @@ const getCurrentComponentName = async (
|
|
|
14
14
|
|
|
15
15
|
const sanitizeEnvVarName = (name: string) => name.replace(/[\s\-.]+/g, "_");
|
|
16
16
|
|
|
17
|
-
const getAllVariablesToPrint = async (
|
|
17
|
+
const getAllVariablesToPrint = async (
|
|
18
|
+
config: Config,
|
|
19
|
+
choice?: {
|
|
20
|
+
env?: string;
|
|
21
|
+
componentName?: string;
|
|
22
|
+
}
|
|
23
|
+
) => {
|
|
24
|
+
const env = choice?.env ?? "local";
|
|
18
25
|
const { components } = config;
|
|
19
26
|
|
|
20
|
-
const currentComponent =
|
|
27
|
+
const currentComponent =
|
|
28
|
+
choice?.componentName ?? (await getCurrentComponentName(components));
|
|
21
29
|
|
|
22
30
|
let variables = {};
|
|
23
31
|
if (currentComponent) {
|
|
24
|
-
variables = await getEnvVars(null,
|
|
32
|
+
variables = await getEnvVars(null, env, currentComponent);
|
|
25
33
|
} else {
|
|
26
34
|
// when in a monorep and not in a subapp, merge all env vars.
|
|
27
35
|
// this is not 100% correct, but better than not exporting any vars at all
|
|
28
36
|
// so we also add prefixed variants
|
|
29
37
|
variables = await Object.keys(components).reduce(
|
|
30
38
|
async (acc, componentName) => {
|
|
31
|
-
const subappvars = await getEnvVars(null,
|
|
39
|
+
const subappvars = await getEnvVars(null, env, componentName);
|
|
32
40
|
return {
|
|
33
41
|
...(await acc),
|
|
34
42
|
...subappvars,
|
|
@@ -46,13 +54,12 @@ const getAllVariablesToPrint = async (config: Config) => {
|
|
|
46
54
|
}
|
|
47
55
|
return variables;
|
|
48
56
|
};
|
|
49
|
-
export default async () => {
|
|
57
|
+
export default async (choice?: { env?: string; componentName?: string }) => {
|
|
50
58
|
const config = await getProjectConfig();
|
|
51
59
|
if (!config) {
|
|
52
60
|
return;
|
|
53
61
|
}
|
|
54
|
-
|
|
55
|
-
const variables = await getAllVariablesToPrint(config);
|
|
62
|
+
const variables = await getAllVariablesToPrint(config, choice);
|
|
56
63
|
|
|
57
64
|
console.log(
|
|
58
65
|
Object.entries(variables)
|
|
@@ -3,14 +3,13 @@ import { spawn } from "child-process-promise";
|
|
|
3
3
|
import { writeFile } from "fs-extra";
|
|
4
4
|
import { withFile } from "tmp-promise";
|
|
5
5
|
import Vorpal from "vorpal";
|
|
6
|
-
import { GOOGLE_CLOUD_SQL_PASS_PATH } from "../../../../config/constants";
|
|
7
6
|
import {
|
|
8
7
|
getEnvVars,
|
|
8
|
+
getGitlabVar,
|
|
9
9
|
getPipelineContextByChoice,
|
|
10
10
|
getProjectConfig,
|
|
11
11
|
parseChoice,
|
|
12
12
|
} from "../../../../config/getProjectConfig";
|
|
13
|
-
import { readPass } from "../../../../utils/passwordstore";
|
|
14
13
|
import { envAndComponents } from "./utils/autocompletions";
|
|
15
14
|
|
|
16
15
|
export default async (vorpal: Vorpal) =>
|
|
@@ -30,8 +29,8 @@ export default async (vorpal: Vorpal) =>
|
|
|
30
29
|
message: "Local port: ",
|
|
31
30
|
});
|
|
32
31
|
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
const envVars = await getEnvVars(this, env, componentName);
|
|
33
|
+
const POSTGRESQL_PASSWORD = envVars?.POSTGRESQL_PASSWORD;
|
|
35
34
|
|
|
36
35
|
const context = await getPipelineContextByChoice(env, componentName);
|
|
37
36
|
if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
|
|
@@ -59,9 +58,23 @@ export default async (vorpal: Vorpal) =>
|
|
|
59
58
|
|
|
60
59
|
const instanceName = `${projectId}:${region}:${instanceId}=tcp:${localPort}`;
|
|
61
60
|
|
|
62
|
-
const
|
|
61
|
+
const cloudsqlProxyCredentials = await getGitlabVar(
|
|
62
|
+
this,
|
|
63
|
+
env,
|
|
64
|
+
componentName,
|
|
65
|
+
"cloudsqlProxyCredentials"
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
if (!cloudsqlProxyCredentials) {
|
|
69
|
+
// we store cloudsqlProxyCredentials on gitlab, but its currently get pushed via bitwarden due to legacy reasons
|
|
70
|
+
// this will be fixed with when https://git.panter.ch/catladder/catladder/-/merge_requests/32/ is merged
|
|
71
|
+
this.log(
|
|
72
|
+
"cloudsqlProxyCredentials env var missing in gitlab. Please contact gilde-ci-cd about that."
|
|
73
|
+
);
|
|
74
|
+
throw new Error("cloudsqlProxyCredentials missing in secrets");
|
|
75
|
+
}
|
|
63
76
|
await withFile(async ({ path: tmpFilePath }) => {
|
|
64
|
-
await writeFile(tmpFilePath,
|
|
77
|
+
await writeFile(tmpFilePath, cloudsqlProxyCredentials);
|
|
65
78
|
|
|
66
79
|
await spawn(
|
|
67
80
|
"cloud_sql_proxy",
|
|
@@ -152,22 +152,26 @@ const doItFor = async (
|
|
|
152
152
|
if (hasBitwarden()) {
|
|
153
153
|
// add cloud sql secret if needed.
|
|
154
154
|
// TODO: this is legacy, in the future we want to have one service account per app
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
155
|
+
try {
|
|
156
|
+
const context = await getPipelineContextByChoice(env, componentName);
|
|
157
|
+
if (
|
|
158
|
+
context.componentConfig.deploy &&
|
|
159
|
+
context.componentConfig.deploy.type === "kubernetes" &&
|
|
160
|
+
context.componentConfig.deploy.values?.cloudsql?.enabled
|
|
161
|
+
) {
|
|
162
|
+
await upsertAllVariables(
|
|
163
|
+
instance,
|
|
164
|
+
{
|
|
165
|
+
cloudsqlProxyCredentials: await readPass(
|
|
166
|
+
GOOGLE_CLOUD_SQL_PASS_PATH
|
|
167
|
+
),
|
|
168
|
+
},
|
|
169
|
+
env,
|
|
170
|
+
componentName
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
} catch (e) {
|
|
174
|
+
// ignore atm
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
177
|
instance.log("✅ " + env + ":" + componentName);
|
|
@@ -24,10 +24,8 @@ import commandPortForward from "./commandPortForward";
|
|
|
24
24
|
import commandTriggerCronjob from "./commandTriggerCronjob";
|
|
25
25
|
|
|
26
26
|
import commandOpenGrafanaPod from "./commandOpenGrafanaPod";
|
|
27
|
-
import commandReloadConfig from "./commandReloadConfig";
|
|
28
27
|
|
|
29
28
|
export default async (vorpal: Vorpal) => {
|
|
30
|
-
commandReloadConfig(vorpal);
|
|
31
29
|
commandSetup(vorpal);
|
|
32
30
|
|
|
33
31
|
commandEnvVars(vorpal);
|
|
@@ -58,8 +58,8 @@ metadata:
|
|
|
58
58
|
namespace: ${namespace}
|
|
59
59
|
name: ${serviceAccountName}
|
|
60
60
|
rules:
|
|
61
|
-
- apiGroups: ["", "extensions", "apps", "networking.k8s.io", "batch"]
|
|
62
|
-
resources: ["deployments", "replicasets", "statefulsets", "pods", "secrets", "configmaps", "services", "ingresses", "serviceaccounts", "jobs", "cronjobs"]
|
|
61
|
+
- apiGroups: ["", "extensions", "apps", "networking.k8s.io", "batch", "autoscaling"]
|
|
62
|
+
resources: ["deployments", "replicasets", "statefulsets", "pods", "secrets", "configmaps", "services", "ingresses", "serviceaccounts", "jobs", "cronjobs", "horizontalpodautoscalers"]
|
|
63
63
|
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] # You can also use ["*"]
|
|
64
64
|
---
|
|
65
65
|
kind: RoleBinding
|
|
@@ -4,7 +4,6 @@ import { writeFile } from "fs-extra";
|
|
|
4
4
|
import { dump } from "js-yaml";
|
|
5
5
|
import { format } from "prettier";
|
|
6
6
|
import { CommandInstance } from "vorpal";
|
|
7
|
-
import { reloadConfig } from "../../../config/getProjectConfig";
|
|
8
7
|
import { getGitRoot } from "../../../utils/projects";
|
|
9
8
|
|
|
10
9
|
export const writeConfig = async (
|
|
@@ -67,7 +66,6 @@ export const writeConfig = async (
|
|
|
67
66
|
);
|
|
68
67
|
await exec("git add " + file);
|
|
69
68
|
}
|
|
70
|
-
await reloadConfig();
|
|
71
69
|
vorpal.log("done!");
|
|
72
70
|
vorpal.log("");
|
|
73
71
|
};
|
package/src/catenv.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import catenv from "./apps/catenv/catenv";
|
|
2
|
-
import {
|
|
2
|
+
import { $, argv } from "zx";
|
|
3
|
+
import { parseChoice } from "./config/getProjectConfig";
|
|
4
|
+
|
|
5
|
+
const choice = argv._[0] ? parseChoice(argv._[0]) : null;
|
|
6
|
+
|
|
3
7
|
$.verbose = false;
|
|
4
|
-
catenv()
|
|
8
|
+
catenv(choice).then(() => {
|
|
9
|
+
// we have to exit manually, because we have some file watches
|
|
10
|
+
process.exit();
|
|
11
|
+
});
|
|
@@ -3,29 +3,42 @@ import {
|
|
|
3
3
|
getAllEnvs,
|
|
4
4
|
getEnvironment as _getEnvironment,
|
|
5
5
|
createContext,
|
|
6
|
+
getSecretVarName,
|
|
7
|
+
Config,
|
|
6
8
|
} from "@catladder/pipeline";
|
|
7
9
|
|
|
8
10
|
import { CommandInstance } from "vorpal";
|
|
9
|
-
import { getAllVariables } from "../utils/gitlab";
|
|
10
|
-
|
|
11
|
+
import { getAllVariables, getVariableValueByRawName } from "../utils/gitlab";
|
|
12
|
+
|
|
11
13
|
import { getGitRoot } from "../utils/projects";
|
|
12
14
|
import { readYaml } from "../utils/files";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
{
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
import { watch } from "fs";
|
|
16
|
+
|
|
17
|
+
let currentConfig: Config = null;
|
|
18
|
+
|
|
19
|
+
// reload the config on change
|
|
20
|
+
const reloadConfigAndObserve = async () => {
|
|
21
|
+
const gitRoot = await getGitRoot();
|
|
22
|
+
const result = readConfigSync(gitRoot);
|
|
23
|
+
if (!result) {
|
|
24
|
+
// can't do anything, there is no config
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const { config, path } = result;
|
|
28
|
+
const watcher = watch(path, () => {
|
|
29
|
+
watcher.close();
|
|
30
|
+
reloadConfigAndObserve();
|
|
31
|
+
});
|
|
32
|
+
currentConfig = config;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const getProjectConfig = async () => {
|
|
36
|
+
if (!currentConfig) {
|
|
37
|
+
// initially
|
|
38
|
+
await reloadConfigAndObserve();
|
|
39
|
+
}
|
|
40
|
+
return currentConfig;
|
|
41
|
+
};
|
|
29
42
|
|
|
30
43
|
export const getGitlabCiFilePath = async () => {
|
|
31
44
|
const gitRoot = await getGitRoot();
|
|
@@ -47,7 +60,7 @@ export const getProjectComponents = async () => {
|
|
|
47
60
|
};
|
|
48
61
|
|
|
49
62
|
export const parseChoice = (envComponent: string) => {
|
|
50
|
-
const [env, componentName] = envComponent.split(":");
|
|
63
|
+
const [env, componentName] = envComponent.split(":").map((x) => x || null);
|
|
51
64
|
return { env, componentName };
|
|
52
65
|
};
|
|
53
66
|
|
|
@@ -98,9 +111,20 @@ export const getAllPipelineContexts = async () => {
|
|
|
98
111
|
|
|
99
112
|
export const getEnvironment = async (env: string, componentName: string) => {
|
|
100
113
|
const config = await getProjectConfig();
|
|
114
|
+
|
|
101
115
|
return _getEnvironment(config, componentName, env);
|
|
102
116
|
};
|
|
103
117
|
|
|
118
|
+
export const getGitlabVar = async (
|
|
119
|
+
vorpal: CommandInstance,
|
|
120
|
+
env: string,
|
|
121
|
+
componentName: string,
|
|
122
|
+
variableName: string
|
|
123
|
+
) => {
|
|
124
|
+
const rawVariableName = getSecretVarName(env, componentName, variableName);
|
|
125
|
+
return await getVariableValueByRawName(vorpal, rawVariableName);
|
|
126
|
+
};
|
|
127
|
+
|
|
104
128
|
const resolveSecrets = async (
|
|
105
129
|
vorpal: CommandInstance,
|
|
106
130
|
allEnvVars: Record<string, string>
|
package/src/utils/gitlab.ts
CHANGED
|
@@ -128,6 +128,14 @@ export const getAllVariables = memoizee(
|
|
|
128
128
|
{ promise: true }
|
|
129
129
|
);
|
|
130
130
|
|
|
131
|
+
export const getVariableValueByRawName = async (
|
|
132
|
+
vorpal: CommandInstance,
|
|
133
|
+
rawName: string
|
|
134
|
+
) => {
|
|
135
|
+
const allVariables = await getAllVariables(vorpal);
|
|
136
|
+
return allVariables.find((v) => v.key === rawName)?.value;
|
|
137
|
+
};
|
|
138
|
+
|
|
131
139
|
const maskableRegex = new RegExp("^[a-zA-Z0-9_+=/@:.~-]{8,}$"); // SEE https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js#L20
|
|
132
140
|
const isMaskable = (value: string): boolean => maskableRegex.test(value);
|
|
133
141
|
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.__esModule = true;
|
|
39
|
-
var getProjectConfig_1 = require("../../../../config/getProjectConfig");
|
|
40
|
-
var showProjectBanner_1 = require("./utils/showProjectBanner");
|
|
41
|
-
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
return __generator(this, function (_a) {
|
|
43
|
-
return [2 /*return*/, vorpal
|
|
44
|
-
.command("project-reload-config", "reloads the config")
|
|
45
|
-
.action(function () {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
-
return __generator(this, function (_a) {
|
|
48
|
-
switch (_a.label) {
|
|
49
|
-
case 0: return [4 /*yield*/, (0, getProjectConfig_1.reloadConfig)()];
|
|
50
|
-
case 1:
|
|
51
|
-
_a.sent();
|
|
52
|
-
return [4 /*yield*/, (0, showProjectBanner_1.showProjectBanner)(vorpal)];
|
|
53
|
-
case 2:
|
|
54
|
-
_a.sent();
|
|
55
|
-
return [2 /*return*/];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
})];
|
|
60
|
-
});
|
|
61
|
-
}); });
|
|
62
|
-
//# sourceMappingURL=commandReloadConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commandReloadConfig.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandReloadConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wEAAmE;AACnE,+DAA8D;AAE9D,sBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CAAC,uBAAuB,EAAE,oBAAoB,CAAC;iBAEtD,MAAM,CAAC;;;;oCACN,qBAAM,IAAA,+BAAY,GAAE,EAAA;;gCAApB,SAAoB,CAAC;gCACrB,qBAAM,IAAA,qCAAiB,EAAC,MAAM,CAAC,EAAA;;gCAA/B,SAA+B,CAAC;;;;;aACjC,CAAC,EAAA;;KAAA,EAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
2
|
-
import { reloadConfig } from "../../../../config/getProjectConfig";
|
|
3
|
-
import { showProjectBanner } from "./utils/showProjectBanner";
|
|
4
|
-
|
|
5
|
-
export default async (vorpal: Vorpal) =>
|
|
6
|
-
vorpal
|
|
7
|
-
.command("project-reload-config", "reloads the config")
|
|
8
|
-
|
|
9
|
-
.action(async function () {
|
|
10
|
-
await reloadConfig();
|
|
11
|
-
await showProjectBanner(vorpal);
|
|
12
|
-
});
|