@magda/scripts 2.0.0-alpha.3 → 2.0.0-alpha.6
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.
|
@@ -48,7 +48,7 @@ const output = `-o ${argv.output}`;
|
|
|
48
48
|
const config = `-c ${argv.config}`;
|
|
49
49
|
|
|
50
50
|
childProcess.execSync(
|
|
51
|
-
`apidoc ${input} -f ".*\.scala$" -f ".*\.ts$" -f ".*\.js$" ${output} ${config}`,
|
|
51
|
+
`apidoc --private true ${input} -f ".*\.scala$" -f ".*\.ts$" -f ".*\.js$" ${output} ${config}`,
|
|
52
52
|
{ stdio: "pipe" }
|
|
53
53
|
);
|
|
54
54
|
|
package/package.json
CHANGED
package/set-scss-vars.js
CHANGED
|
@@ -48,9 +48,14 @@ async function run(programOptions) {
|
|
|
48
48
|
const env = getEnvByClusterType(programOptions.isMinikube === true);
|
|
49
49
|
checkIfKubectlValid(env);
|
|
50
50
|
checkNamespace(env, namespace);
|
|
51
|
-
const image = createConfigMap(
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const [image, pullSecrets] = createConfigMap(
|
|
52
|
+
env,
|
|
53
|
+
namespace,
|
|
54
|
+
COMPILER_CONFIG_MAP_NAME,
|
|
55
|
+
{
|
|
56
|
+
[COMPILER_CONFIG_MAP_KEY]: JSON.stringify(vars)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
54
59
|
console.log(
|
|
55
60
|
chalk.green(
|
|
56
61
|
`Successfully created config \`${COMPILER_CONFIG_MAP_NAME}\` in namespace \`${namespace}\`.`
|
|
@@ -59,7 +64,7 @@ async function run(programOptions) {
|
|
|
59
64
|
console.log(
|
|
60
65
|
chalk.yellow(`Creating updating job in namespace \`${namespace}\`...`)
|
|
61
66
|
);
|
|
62
|
-
const jobId = createJob(env, namespace, image);
|
|
67
|
+
const jobId = createJob(env, namespace, image, pullSecrets);
|
|
63
68
|
console.log(
|
|
64
69
|
chalk.green(
|
|
65
70
|
`Job \`${jobId}\` in namespace \`${namespace}\` has been created.`
|
|
@@ -192,11 +197,21 @@ function createConfigMap(env, namespace, configMapName, data) {
|
|
|
192
197
|
input: configContent,
|
|
193
198
|
env: env
|
|
194
199
|
});
|
|
195
|
-
|
|
200
|
+
|
|
201
|
+
let pullSecrets;
|
|
202
|
+
if (configObj.data.pullSecrets) {
|
|
203
|
+
try {
|
|
204
|
+
pullSecrets = JSON.parse(configObj.data.pullSecrets);
|
|
205
|
+
} catch (e) {
|
|
206
|
+
console.log("No valid pullSecrets info found from configMap.");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return [configObj.data.image, pullSecrets];
|
|
196
211
|
}
|
|
197
212
|
|
|
198
|
-
function buildJobTemplateObject(namespace, jobId, image) {
|
|
199
|
-
|
|
213
|
+
function buildJobTemplateObject(namespace, jobId, image, pullSecrets) {
|
|
214
|
+
const manifest = {
|
|
200
215
|
kind: "Job",
|
|
201
216
|
apiVersion: "batch/v1",
|
|
202
217
|
metadata: {
|
|
@@ -257,11 +272,19 @@ function buildJobTemplateObject(namespace, jobId, image) {
|
|
|
257
272
|
}
|
|
258
273
|
}
|
|
259
274
|
};
|
|
275
|
+
if (pullSecrets && pullSecrets.length) {
|
|
276
|
+
manifest.spec.template.spec.imagePullSecrets = pullSecrets.map(
|
|
277
|
+
(item) => ({
|
|
278
|
+
name: item
|
|
279
|
+
})
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
return manifest;
|
|
260
283
|
}
|
|
261
284
|
|
|
262
|
-
function createJob(env, namespace, image) {
|
|
285
|
+
function createJob(env, namespace, image, pullSecrets) {
|
|
263
286
|
const jobId = uniqid("scss-compiler-");
|
|
264
|
-
const jobObj = buildJobTemplateObject(namespace, jobId, image);
|
|
287
|
+
const jobObj = buildJobTemplateObject(namespace, jobId, image, pullSecrets);
|
|
265
288
|
|
|
266
289
|
const configContent = JSON.stringify(jobObj);
|
|
267
290
|
|
|
@@ -92,16 +92,18 @@ function updateChartVersion(chartFilePath) {
|
|
|
92
92
|
for (let i = 0; i < deps.items.length; i++) {
|
|
93
93
|
const repoStr = chart.getIn(["dependencies", i, "repository"]);
|
|
94
94
|
const nameStr = chart.getIn(["dependencies", i, "name"]);
|
|
95
|
+
|
|
95
96
|
if (
|
|
96
97
|
typeof repoStr === "string" &&
|
|
97
98
|
repoStr.indexOf("file://") === 0 &&
|
|
98
|
-
excludedCharts.length
|
|
99
|
-
|
|
99
|
+
(!excludedCharts.length ||
|
|
100
|
+
excludedCharts.indexOf(nameStr) === -1)
|
|
100
101
|
) {
|
|
101
102
|
const version = chart.getIn(
|
|
102
103
|
["dependencies", i, "version"],
|
|
103
104
|
true
|
|
104
105
|
);
|
|
106
|
+
|
|
105
107
|
if (version) {
|
|
106
108
|
version.value = pkgVersion;
|
|
107
109
|
} else {
|