@vaharoni/devops 1.3.1 → 1.3.2
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/{chunk-UZAJJUGJ.js → chunk-JQGPJAPS.js} +1 -1
- package/dist/{chunk-QOZ6NZJC.js → chunk-STUOTOGE.js} +1 -1
- package/dist/{chunk-6FEVIEFY.js → chunk-VZ6XNNUH.js} +1 -1
- package/dist/devops.js +14 -16
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/plugins.js +2 -2
- package/dist/src/target-templates/infra-variants/hetzner/.devops/config/constants.yaml +2 -2
- package/package.json +1 -1
- package/src/libs/registry/image-pull-secret.ts +9 -11
- package/src/target-templates/infra-variants/hetzner/.devops/config/constants.yaml +2 -2
- package/src/types/index.ts +1 -1
|
@@ -10,7 +10,7 @@ var SUPPORTED_LANGUAGES = ["python", "node"];
|
|
|
10
10
|
var constFileSchema = z.object({
|
|
11
11
|
"project-name": z.string(),
|
|
12
12
|
"registry-infra": z.enum(["digitalocean", "gcp", "harbor"]),
|
|
13
|
-
"
|
|
13
|
+
"image-pull-secret-name": z.string().optional(),
|
|
14
14
|
"image-versions-to-keep": z.number().optional(),
|
|
15
15
|
"registry-base-url": z.string(),
|
|
16
16
|
"registry-image-path-prefix": z.string().optional(),
|
package/dist/devops.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import {
|
|
3
3
|
InternalToken
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JQGPJAPS.js";
|
|
5
5
|
import {
|
|
6
6
|
CLICommandParser,
|
|
7
7
|
CommandExecutor,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
printUsageAndExit,
|
|
25
25
|
secretName,
|
|
26
26
|
upsertConfigMapCommand
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-STUOTOGE.js";
|
|
28
28
|
import {
|
|
29
29
|
IGNORED_PATHS,
|
|
30
30
|
__export,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
getWorkspace,
|
|
37
37
|
globEnvYamlFiles,
|
|
38
38
|
workspaceDirectoryForLanguage
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-VZ6XNNUH.js";
|
|
40
40
|
|
|
41
41
|
// src/devops.ts
|
|
42
42
|
import { globSync as globSync2 } from "glob";
|
|
@@ -386,8 +386,8 @@ function setWorkspaceScale(monorepoEnv, image2, workspaceName, replicaCount) {
|
|
|
386
386
|
}
|
|
387
387
|
const { scale: _scale, ...rest } = getImageConfigMap(monorepoEnv, image2);
|
|
388
388
|
const parsedScale = deserializeImageConfigMapKey(monorepoEnv, image2, "scale");
|
|
389
|
-
const
|
|
390
|
-
if (!
|
|
389
|
+
const isApplicable = setK8sScale(monorepoEnv, workspaceName, replicaCount);
|
|
390
|
+
if (!isApplicable) return;
|
|
391
391
|
updateImageConfigMap(monorepoEnv, image2, {
|
|
392
392
|
...rest,
|
|
393
393
|
scale: JSON.stringify({
|
|
@@ -2068,18 +2068,15 @@ function run11(cmdObj) {
|
|
|
2068
2068
|
var job = { oneLiner: oneLiner11, keyExamples: keyExamples11, run: run11 };
|
|
2069
2069
|
|
|
2070
2070
|
// src/libs/registry/image-pull-secret.ts
|
|
2071
|
-
var SECRET_NAME = "external-registry-secret";
|
|
2072
2071
|
var SOURCE_NAMESPACE = "default";
|
|
2073
|
-
function
|
|
2074
|
-
const
|
|
2075
|
-
|
|
2076
|
-
return false;
|
|
2077
|
-
}
|
|
2078
|
-
return true;
|
|
2072
|
+
function getSecretName() {
|
|
2073
|
+
const secretName2 = getConst("image-pull-secret-name");
|
|
2074
|
+
return secretName2 || null;
|
|
2079
2075
|
}
|
|
2080
2076
|
function copyRegistrySecretToNamespace(monorepoEnv) {
|
|
2081
|
-
|
|
2082
|
-
|
|
2077
|
+
const secretName2 = getSecretName();
|
|
2078
|
+
if (!secretName2) return;
|
|
2079
|
+
const cmd = kubectlCommand(`get secret ${secretName2} -o json`, {
|
|
2083
2080
|
monorepoEnv,
|
|
2084
2081
|
namespace: SOURCE_NAMESPACE
|
|
2085
2082
|
});
|
|
@@ -2103,9 +2100,10 @@ function copyRegistrySecretToNamespace(monorepoEnv) {
|
|
|
2103
2100
|
new CommandExecutor(copyCmd, { quiet: true }).exec();
|
|
2104
2101
|
}
|
|
2105
2102
|
function patchServiceAccountImagePullSecret(monorepoEnv) {
|
|
2106
|
-
|
|
2103
|
+
const secretName2 = getSecretName();
|
|
2104
|
+
if (!secretName2) return;
|
|
2107
2105
|
const cmd = kubectlCommand(
|
|
2108
|
-
`patch serviceaccount default -p '{"imagePullSecrets": [{"name": "${
|
|
2106
|
+
`patch serviceaccount default -p '{"imagePullSecrets": [{"name": "${secretName2}"}]}'`,
|
|
2109
2107
|
{ monorepoEnv }
|
|
2110
2108
|
);
|
|
2111
2109
|
new CommandExecutor(cmd, { quiet: true }).exec();
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type SupportedLanguages = typeof SUPPORTED_LANGUAGES[number];
|
|
|
5
5
|
declare const constFileSchema: z.ZodObject<{
|
|
6
6
|
"project-name": z.ZodString;
|
|
7
7
|
"registry-infra": z.ZodEnum<["digitalocean", "gcp", "harbor"]>;
|
|
8
|
-
"
|
|
8
|
+
"image-pull-secret-name": z.ZodOptional<z.ZodString>;
|
|
9
9
|
"image-versions-to-keep": z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
"registry-base-url": z.ZodString;
|
|
11
11
|
"registry-image-path-prefix": z.ZodOptional<z.ZodString>;
|
|
@@ -19,7 +19,7 @@ declare const constFileSchema: z.ZodObject<{
|
|
|
19
19
|
"registry-base-url": string;
|
|
20
20
|
"extra-remote-environments": string[];
|
|
21
21
|
"extra-local-environments": string[];
|
|
22
|
-
"
|
|
22
|
+
"image-pull-secret-name"?: string | undefined;
|
|
23
23
|
"image-versions-to-keep"?: number | undefined;
|
|
24
24
|
"registry-image-path-prefix"?: string | undefined;
|
|
25
25
|
"cloudrun-artifact-registry-repo-path"?: string | undefined;
|
|
@@ -30,7 +30,7 @@ declare const constFileSchema: z.ZodObject<{
|
|
|
30
30
|
"registry-base-url": string;
|
|
31
31
|
"extra-remote-environments": string[];
|
|
32
32
|
"extra-local-environments": string[];
|
|
33
|
-
"
|
|
33
|
+
"image-pull-secret-name"?: string | undefined;
|
|
34
34
|
"image-versions-to-keep"?: number | undefined;
|
|
35
35
|
"registry-image-path-prefix"?: string | undefined;
|
|
36
36
|
"cloudrun-artifact-registry-repo-path"?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
InternalToken,
|
|
3
3
|
decryptAes256Gcm,
|
|
4
4
|
encryptAes256Gcm
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JQGPJAPS.js";
|
|
6
6
|
import {
|
|
7
7
|
SUPPORTED_LANGUAGES,
|
|
8
8
|
constFileSchema,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
packageFileNodeSchema,
|
|
11
11
|
packageFilePythonSchema,
|
|
12
12
|
workspaces
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VZ6XNNUH.js";
|
|
14
14
|
|
|
15
15
|
// src/app-support/discovery/dev-discovery-loader.ts
|
|
16
16
|
var _portLookupByServiceName = null;
|
package/dist/plugins.js
CHANGED
|
@@ -4,9 +4,9 @@ project-name: $PROJECT_NAME
|
|
|
4
4
|
# Registry infrastructure: digitalocean, gcp, or harbor
|
|
5
5
|
registry-infra: harbor
|
|
6
6
|
|
|
7
|
-
# When
|
|
7
|
+
# When set, devops namespace create will copy this secret from default namespace
|
|
8
8
|
# and patch the default service account to use it. See docs/infra/RegistrySetup.md for details.
|
|
9
|
-
|
|
9
|
+
image-pull-secret-name: $PROJECT_NAME-registry-secret
|
|
10
10
|
|
|
11
11
|
# Only relevant for Digital Ocean. Determines the number of versions to keep for each docker image.
|
|
12
12
|
image-versions-to-keep: 5
|
package/package.json
CHANGED
|
@@ -3,21 +3,18 @@ import { getConst } from "../config";
|
|
|
3
3
|
import { envToNamespace } from "../k8s-constants";
|
|
4
4
|
import { kubectlCommand } from "../k8s-helpers";
|
|
5
5
|
|
|
6
|
-
const SECRET_NAME = "external-registry-secret";
|
|
7
6
|
const SOURCE_NAMESPACE = "default";
|
|
8
7
|
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return true;
|
|
8
|
+
function getSecretName(): string | null {
|
|
9
|
+
const secretName = getConst("image-pull-secret-name");
|
|
10
|
+
return secretName || null;
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
export function copyRegistrySecretToNamespace(monorepoEnv: string) {
|
|
18
|
-
|
|
14
|
+
const secretName = getSecretName();
|
|
15
|
+
if (!secretName) return;
|
|
19
16
|
|
|
20
|
-
const cmd = kubectlCommand(`get secret ${
|
|
17
|
+
const cmd = kubectlCommand(`get secret ${secretName} -o json`, {
|
|
21
18
|
monorepoEnv,
|
|
22
19
|
namespace: SOURCE_NAMESPACE,
|
|
23
20
|
});
|
|
@@ -44,10 +41,11 @@ export function copyRegistrySecretToNamespace(monorepoEnv: string) {
|
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
export function patchServiceAccountImagePullSecret(monorepoEnv: string) {
|
|
47
|
-
|
|
44
|
+
const secretName = getSecretName();
|
|
45
|
+
if (!secretName) return;
|
|
48
46
|
|
|
49
47
|
const cmd = kubectlCommand(
|
|
50
|
-
`patch serviceaccount default -p '{"imagePullSecrets": [{"name": "${
|
|
48
|
+
`patch serviceaccount default -p '{"imagePullSecrets": [{"name": "${secretName}"}]}'`,
|
|
51
49
|
{ monorepoEnv }
|
|
52
50
|
);
|
|
53
51
|
new CommandExecutor(cmd, { quiet: true }).exec();
|
|
@@ -4,9 +4,9 @@ project-name: $PROJECT_NAME
|
|
|
4
4
|
# Registry infrastructure: digitalocean, gcp, or harbor
|
|
5
5
|
registry-infra: harbor
|
|
6
6
|
|
|
7
|
-
# When
|
|
7
|
+
# When set, devops namespace create will copy this secret from default namespace
|
|
8
8
|
# and patch the default service account to use it. See docs/infra/RegistrySetup.md for details.
|
|
9
|
-
|
|
9
|
+
image-pull-secret-name: $PROJECT_NAME-registry-secret
|
|
10
10
|
|
|
11
11
|
# Only relevant for Digital Ocean. Determines the number of versions to keep for each docker image.
|
|
12
12
|
image-versions-to-keep: 5
|
package/src/types/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type SupportedLanguages = typeof SUPPORTED_LANGUAGES[number];
|
|
|
8
8
|
export const constFileSchema = z.object({
|
|
9
9
|
"project-name": z.string(),
|
|
10
10
|
"registry-infra": z.enum(["digitalocean", "gcp", "harbor"]),
|
|
11
|
-
"
|
|
11
|
+
"image-pull-secret-name": z.string().optional(),
|
|
12
12
|
"image-versions-to-keep": z.number().optional(),
|
|
13
13
|
"registry-base-url": z.string(),
|
|
14
14
|
"registry-image-path-prefix": z.string().optional(),
|