@cbnventures/nova 0.38.0 → 0.40.0
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/build/package.json +1 -1
- package/build/scaffold-versions.json +10 -9
- package/build/src/api/app-store-connect.d.ts +17 -2
- package/build/src/api/app-store-connect.d.ts.map +1 -1
- package/build/src/api/app-store-connect.js +654 -171
- package/build/src/api/app-store-connect.js.map +1 -1
- package/build/src/api/docker-hub.d.ts +14 -0
- package/build/src/api/docker-hub.d.ts.map +1 -0
- package/build/src/api/docker-hub.js +275 -0
- package/build/src/api/docker-hub.js.map +1 -0
- package/build/src/api/github-runner-images.d.ts +13 -0
- package/build/src/api/github-runner-images.d.ts.map +1 -0
- package/build/src/api/github-runner-images.js +238 -0
- package/build/src/api/github-runner-images.js.map +1 -0
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts +2 -2
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint-validate.js +260 -50
- package/build/src/cli/generate/github/workflows-blueprint-validate.js.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint.d.ts +6 -4
- package/build/src/cli/generate/github/workflows-blueprint.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint.js +632 -74
- package/build/src/cli/generate/github/workflows-blueprint.js.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.js +1 -0
- package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
- package/build/src/cli/index.js +41 -1
- package/build/src/cli/index.js.map +1 -1
- package/build/src/cli/integration/app-store-connect.d.ts +10 -0
- package/build/src/cli/integration/app-store-connect.d.ts.map +1 -1
- package/build/src/cli/integration/app-store-connect.js +701 -80
- package/build/src/cli/integration/app-store-connect.js.map +1 -1
- package/build/src/cli/recipe/docker-hub/docker-hub-precheck.d.ts +3 -0
- package/build/src/cli/recipe/docker-hub/docker-hub-precheck.d.ts.map +1 -0
- package/build/src/cli/recipe/docker-hub/docker-hub-precheck.js +72 -0
- package/build/src/cli/recipe/docker-hub/docker-hub-precheck.js.map +1 -0
- package/build/src/cli/recipe/docker-hub/sync-identity.d.ts +5 -0
- package/build/src/cli/recipe/docker-hub/sync-identity.d.ts.map +1 -0
- package/build/src/cli/recipe/docker-hub/sync-identity.js +124 -0
- package/build/src/cli/recipe/docker-hub/sync-identity.js.map +1 -0
- package/build/src/cli/recipe/docker-hub/sync-policies.d.ts +5 -0
- package/build/src/cli/recipe/docker-hub/sync-policies.d.ts.map +1 -0
- package/build/src/cli/recipe/docker-hub/sync-policies.js +63 -0
- package/build/src/cli/recipe/docker-hub/sync-policies.js.map +1 -0
- package/build/src/cli/recipe/index.d.ts.map +1 -1
- package/build/src/cli/recipe/index.js +12 -0
- package/build/src/cli/recipe/index.js.map +1 -1
- package/build/src/cli/recipe/nova-config/normalize-order.js +3 -3
- package/build/src/cli/recipe/nova-config/normalize-order.js.map +1 -1
- package/build/src/cli/scaffold/package/pfsense.d.ts +3 -0
- package/build/src/cli/scaffold/package/pfsense.d.ts.map +1 -1
- package/build/src/cli/scaffold/package/pfsense.js +140 -6
- package/build/src/cli/scaffold/package/pfsense.js.map +1 -1
- package/build/src/cli/scaffold/tool/serverless.d.ts +2 -0
- package/build/src/cli/scaffold/tool/serverless.d.ts.map +1 -1
- package/build/src/cli/scaffold/tool/serverless.js +35 -1
- package/build/src/cli/scaffold/tool/serverless.js.map +1 -1
- package/build/src/cli/utility/changelog.d.ts +7 -0
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +800 -7
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/configure.d.ts +4 -1
- package/build/src/cli/utility/configure.d.ts.map +1 -1
- package/build/src/cli/utility/configure.js +396 -24
- package/build/src/cli/utility/configure.js.map +1 -1
- package/build/src/lib/docker-packaging.d.ts +1 -0
- package/build/src/lib/docker-packaging.d.ts.map +1 -1
- package/build/src/lib/docker-packaging.js +39 -2
- package/build/src/lib/docker-packaging.js.map +1 -1
- package/build/src/lib/env-namespace.d.ts.map +1 -1
- package/build/src/lib/env-namespace.js +2 -1
- package/build/src/lib/env-namespace.js.map +1 -1
- package/build/src/lib/item.d.ts +2 -1
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +23 -0
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/nova-config-order.d.ts.map +1 -1
- package/build/src/lib/nova-config-order.js +35 -1
- package/build/src/lib/nova-config-order.js.map +1 -1
- package/build/src/lib/nova-config.d.ts +1 -0
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +178 -3
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/regex.d.ts +16 -0
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +16 -0
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/scaffold.d.ts +3 -3
- package/build/src/lib/scaffold.d.ts.map +1 -1
- package/build/src/lib/scaffold.js +111 -8
- package/build/src/lib/scaffold.js.map +1 -1
- package/build/src/lib/schema.d.ts +34 -0
- package/build/src/lib/schema.d.ts.map +1 -1
- package/build/src/lib/schema.js +31 -0
- package/build/src/lib/schema.js.map +1 -1
- package/build/src/lib/workflow-templates.d.ts +4 -1
- package/build/src/lib/workflow-templates.d.ts.map +1 -1
- package/build/src/lib/workflow-templates.js +46 -16
- package/build/src/lib/workflow-templates.js.map +1 -1
- package/build/src/types/api/app-store-connect.d.ts +476 -33
- package/build/src/types/api/docker-hub.d.ts +237 -0
- package/build/src/types/api/github-runner-images.d.ts +199 -0
- package/build/src/types/cli/generate/github/workflows-blueprint-validate.d.ts +79 -17
- package/build/src/types/cli/generate/github/workflows-blueprint.d.ts +131 -9
- package/build/src/types/cli/index.d.ts +2 -0
- package/build/src/types/cli/integration/app-store-connect.d.ts +470 -6
- package/build/src/types/cli/recipe/docker-hub/docker-hub-precheck.d.ts +78 -0
- package/build/src/types/cli/recipe/docker-hub/sync-identity.d.ts +80 -0
- package/build/src/types/cli/recipe/docker-hub/sync-policies.d.ts +57 -0
- package/build/src/types/cli/recipe/index.d.ts +3 -1
- package/build/src/types/cli/scaffold/package/pfsense.d.ts +83 -0
- package/build/src/types/cli/scaffold/tool/serverless.d.ts +30 -0
- package/build/src/types/cli/utility/changelog.d.ts +327 -1
- package/build/src/types/cli/utility/configure.d.ts +199 -4
- package/build/src/types/lib/docker-packaging.d.ts +25 -1
- package/build/src/types/lib/env-namespace.d.ts +4 -1
- package/build/src/types/lib/item.d.ts +11 -0
- package/build/src/types/lib/nova-config-order.d.ts +34 -1
- package/build/src/types/lib/nova-config.d.ts +100 -0
- package/build/src/types/lib/regex.d.ts +91 -0
- package/build/src/types/lib/scaffold.d.ts +48 -4
- package/build/src/types/lib/workflow-templates.d.ts +26 -0
- package/build/src/types/shared.d.ts +353 -3
- package/build/src/types/tests/api/app-store-connect.test.d.ts +162 -0
- package/build/src/types/tests/api/docker-hub.test.d.ts +84 -0
- package/build/src/types/tests/api/github-runner-images.test.d.ts +113 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-generate.test.d.ts +19 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-parity.test.d.ts +0 -9
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-publish-parity.test.d.ts +108 -25
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-validate.test.d.ts +139 -30
- package/build/src/types/tests/cli/generate/github/workflows-blueprint.test.d.ts +45 -0
- package/build/src/types/tests/cli/generate/github/workflows-version-contract.test.d.ts +2 -2
- package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +2 -0
- package/build/src/types/tests/cli/integration/app-store-connect.test.d.ts +876 -0
- package/build/src/types/tests/cli/recipe/nova-config/normalize-order.test.d.ts +4 -0
- package/build/src/types/tests/cli/scaffold/tool/serverless.test.d.ts +21 -0
- package/build/src/types/tests/cli/utility/changelog-android.test.d.ts +14 -0
- package/build/src/types/tests/cli/utility/changelog-apple.test.d.ts +21 -0
- package/build/src/types/tests/cli/utility/changelog-fold.test.d.ts +350 -0
- package/build/src/types/tests/cli/utility/changelog.test.d.ts +50 -0
- package/build/src/types/tests/cli/utility/configure.test.d.ts +90 -0
- package/build/src/types/tests/lib/nova-config.test.d.ts +29 -1
- package/build/src/types/tests/lib/scaffold.test.d.ts +59 -2
- package/build/src/types/tests/scaffold-output-contract.test.d.ts +136 -0
- package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +1 -0
- package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +1 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/nova.md +6 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/pfsense.md +311 -0
- package/build/templates/scaffold/app/android/package.json +1 -1
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-ios-1024.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-128.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-128@2x.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-16.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-16@2x.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-256.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-256@2x.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-32.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-32@2x.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-512.png +0 -0
- package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-512@2x.png +0 -0
- package/build/templates/scaffold/app/apple/package.json +1 -1
- package/build/templates/scaffold/app/astro/package.json +1 -1
- package/build/templates/scaffold/app/discord-bot/package.json +1 -1
- package/build/templates/scaffold/app/express/package.json +1 -1
- package/build/templates/scaffold/app/nextjs/package.json +1 -1
- package/build/templates/scaffold/app/vite/package.json +1 -1
- package/build/templates/scaffold/docs/docusaurus/package.json +2 -2
- package/build/templates/scaffold/package/github-action/package.json +1 -1
- package/build/templates/scaffold/package/homebridge/package.json +1 -1
- package/build/templates/scaffold/package/pfsense/package.json +2 -2
- package/build/templates/scaffold/package/pfsense/port/Makefile.template +16 -1
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__]/FileLock.php +93 -0
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__]/PackagePaths.php +40 -0
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__]/UpdateManager.php +1667 -0
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].inc +161 -13
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].xml +37 -0
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/sbin/[__WORKSPACE_NAME__] +203 -8
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/share/pfSense-pkg-[__WORKSPACE_IDENTIFIER__]/logo.svg +12 -0
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/share/pfSense-pkg-[__WORKSPACE_IDENTIFIER__]/release-signing.pub +9 -0
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/www/[__WORKSPACE_NAME__]-about.php +437 -0
- package/build/templates/scaffold/package/pfsense/port/pkg-plist +6 -0
- package/build/templates/scaffold/package/pfsense/scripts/build-package.sh +61 -0
- package/build/templates/scaffold/package/pfsense/scripts/check-package.mjs +114 -1
- package/build/templates/scaffold/package/pfsense/scripts/regex.mjs +10 -0
- package/build/templates/scaffold/package/pfsense/scripts/stage-package.mjs +48 -2
- package/build/templates/scaffold/package/pfsense/tests/updates.php +695 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/drawable/ic_launcher_background.xml +1 -1
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/build/templates/scaffold-options/docker-image/common/Dockerfile +7 -0
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/package.json +1 -1
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/types/worker/index.test.d.ts +40 -2
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/types/worker/landing-page.d.ts +23 -0
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/worker/index.test.ts +119 -4
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/worker/index.ts +25 -3
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/worker/landing-page.ts +278 -0
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/api/index.test.ts +121 -6
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/api/index.ts +49 -12
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/package.json +3 -1
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/function/landing-page.ts +278 -0
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/types/api/index.d.ts +17 -2
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/types/api/index.test.d.ts +40 -2
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/types/function/landing-page.d.ts +23 -0
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/tsconfig.functions.json +3 -1
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/vercel.json +7 -1
- package/package.json +1 -1
- package/build/templates/scaffold/package/pfsense-root/.github/workflows/pfsense-[__WORKSPACE_NAME__].yml +0 -62
|
@@ -4,9 +4,9 @@ import { Logger } from '../toolkit/index.js';
|
|
|
4
4
|
import { libEnvNamespace } from './env-namespace.js';
|
|
5
5
|
import { getSupportedIgnoreFileBundles, isSupportedIgnoreFileConfigPath, } from './ignore-files.js';
|
|
6
6
|
import { libItemAllowedAgents, libItemAllowedPoliciesByRole, libItemAllowedRoles, libItemEmailFields, libItemGenericProtocols, libItemOperatingSystemFilesByPlatform, libItemRecipesByCategory, libItemRepositoryProtocols, libItemUrlFields, } from './item.js';
|
|
7
|
-
import { LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REGEX_PATTERN_GITHUB_LABEL_COLOR, LIB_REGEX_PATTERN_GITHUB_OWNER, LIB_REGEX_PATTERN_GITHUB_REPO, LIB_REGEX_PATTERN_SLUG_SCOPED, LIB_REGEX_PATTERN_SLUG_SIMPLE, } from './regex.js';
|
|
7
|
+
import { LIB_REGEX_PATTERN_DOCKER_HUB_CATEGORY_SLUG, LIB_REGEX_PATTERN_DOCKER_IMAGE_COMPONENT, LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REGEX_PATTERN_GITHUB_LABEL_COLOR, LIB_REGEX_PATTERN_GITHUB_OWNER, LIB_REGEX_PATTERN_GITHUB_REPO, LIB_REGEX_PATTERN_SLUG_SCOPED, LIB_REGEX_PATTERN_SLUG_SIMPLE, } from './regex.js';
|
|
8
8
|
import { isFileIdentical, isPlainObject, pathExists, renameFileWithDate, } from './utility.js';
|
|
9
|
-
import { libWorkflowTemplatesMetadata } from './workflow-templates.js';
|
|
9
|
+
import { libWorkflowStepKinds, libWorkflowTemplatesMetadata, } from './workflow-templates.js';
|
|
10
10
|
export class Runner {
|
|
11
11
|
#config;
|
|
12
12
|
#diagnostics = [];
|
|
@@ -61,6 +61,7 @@ export class Runner {
|
|
|
61
61
|
const entities = this.parseEntities(value['entities']);
|
|
62
62
|
const emails = this.parseEmails(value['emails']);
|
|
63
63
|
const github = this.parseGithub(value['github']);
|
|
64
|
+
const dockerHub = this.parseDockerHub(value['dockerHub']);
|
|
64
65
|
const urls = this.parseUrls(value['urls']);
|
|
65
66
|
const readMe = this.parseReadMe(value['readme'], github, urls);
|
|
66
67
|
const workspaces = this.parseWorkspaces(value['workspaces'], (project !== undefined && project['name'] !== undefined) ? project['name']['slug'] : undefined);
|
|
@@ -71,6 +72,13 @@ export class Runner {
|
|
|
71
72
|
const recipes = this.parseRecipes(value['recipes']);
|
|
72
73
|
const environment = this.parseEnvironment(value['environment'], workspaces, workflows);
|
|
73
74
|
const settings = this.parseSettings(value['settings']);
|
|
75
|
+
if (dockerHub !== undefined
|
|
76
|
+
&& project !== undefined
|
|
77
|
+
&& project['description'] !== undefined
|
|
78
|
+
&& project['description']['short'] !== undefined
|
|
79
|
+
&& project['description']['short'].length > 100) {
|
|
80
|
+
this.pushWarning('Runner.parse', 'dockerHub', 'Project short description exceeds Docker Hub\'s 100-character limit. The sync-identity recipe will not update the repository.');
|
|
81
|
+
}
|
|
74
82
|
this.validateCredContributors(value['workflows'], environment);
|
|
75
83
|
if (project !== undefined) {
|
|
76
84
|
result.project = project;
|
|
@@ -84,6 +92,9 @@ export class Runner {
|
|
|
84
92
|
if (github !== undefined) {
|
|
85
93
|
result.github = github;
|
|
86
94
|
}
|
|
95
|
+
if (dockerHub !== undefined) {
|
|
96
|
+
result.dockerHub = dockerHub;
|
|
97
|
+
}
|
|
87
98
|
if (workflows !== undefined) {
|
|
88
99
|
result.workflows = workflows;
|
|
89
100
|
}
|
|
@@ -531,6 +542,9 @@ export class Runner {
|
|
|
531
542
|
if (projectPrefix === undefined) {
|
|
532
543
|
this.pushError('Runner.parseEnvironment', 'environment', 'Environment "project" has no prefix. Skipping ...');
|
|
533
544
|
}
|
|
545
|
+
else if (libEnvNamespace.isValidPrefix(projectPrefix) === false) {
|
|
546
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment "project" prefix "${projectPrefix}" is invalid. Prefixes must be one uppercase word containing letters or digits, starting with a letter, followed by "_" (for example, "CBN_"). Skipping ...`);
|
|
547
|
+
}
|
|
534
548
|
else if (libEnvNamespace.isReservedPrefix(projectPrefix) === true) {
|
|
535
549
|
this.pushError('Runner.parseEnvironment', 'environment', `Environment "project" prefix "${projectPrefix}" is reserved and cannot be used. Skipping ...`);
|
|
536
550
|
}
|
|
@@ -562,6 +576,10 @@ export class Runner {
|
|
|
562
576
|
this.pushError('Runner.parseEnvironment', 'environment', `Environment workspace "${workspacePath}" has no prefix. Skipping ...`);
|
|
563
577
|
continue;
|
|
564
578
|
}
|
|
579
|
+
if (libEnvNamespace.isValidPrefix(workspacePrefix) === false) {
|
|
580
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment workspace "${workspacePath}" prefix "${workspacePrefix}" is invalid. Prefixes must be one uppercase word containing letters or digits, starting with a letter, followed by "_" (for example, "CBN_"). Skipping ...`);
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
565
583
|
if (libEnvNamespace.isReservedPrefix(workspacePrefix) === true) {
|
|
566
584
|
this.pushError('Runner.parseEnvironment', 'environment', `Environment workspace "${workspacePath}" prefix "${workspacePrefix}" is reserved and cannot be used. Skipping ...`);
|
|
567
585
|
continue;
|
|
@@ -601,6 +619,10 @@ export class Runner {
|
|
|
601
619
|
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" has no prefix. Skipping ...`);
|
|
602
620
|
continue;
|
|
603
621
|
}
|
|
622
|
+
if (libEnvNamespace.isValidPrefix(workflowPrefix) === false) {
|
|
623
|
+
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" prefix "${workflowPrefix}" is invalid. Prefixes must be one uppercase word containing letters or digits, starting with a letter, followed by "_" (for example, "CBN_"). Skipping ...`);
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
604
626
|
if (libEnvNamespace.isReservedPrefix(workflowPrefix) === true) {
|
|
605
627
|
this.pushError('Runner.parseEnvironment', 'environment', `Environment workflow "${workflowName}" prefix "${workflowPrefix}" is reserved and cannot be used. Skipping ...`);
|
|
606
628
|
continue;
|
|
@@ -895,12 +917,31 @@ export class Runner {
|
|
|
895
917
|
triggers.push(triggerObject);
|
|
896
918
|
}
|
|
897
919
|
const rawRunsOn = castItem['runsOn'];
|
|
898
|
-
const runsOn = (rawRunsOn
|
|
920
|
+
const runsOn = this.getNonEmptyString(rawRunsOn);
|
|
899
921
|
const rawTimeoutMinutes = castItem['timeoutMinutes'];
|
|
900
922
|
const timeoutMinutes = (typeof rawTimeoutMinutes === 'number'
|
|
901
923
|
&& Number.isInteger(rawTimeoutMinutes) === true
|
|
902
924
|
&& rawTimeoutMinutes >= 1
|
|
903
925
|
&& rawTimeoutMinutes <= 360) ? rawTimeoutMinutes : undefined;
|
|
926
|
+
const rawBuildTimeoutMinutes = castItem['buildTimeoutMinutes'];
|
|
927
|
+
const buildTimeoutMinutes = (typeof rawBuildTimeoutMinutes === 'number'
|
|
928
|
+
&& Number.isInteger(rawBuildTimeoutMinutes) === true
|
|
929
|
+
&& rawBuildTimeoutMinutes >= 1
|
|
930
|
+
&& rawBuildTimeoutMinutes <= 360) ? rawBuildTimeoutMinutes : undefined;
|
|
931
|
+
const rawStepTimeoutMinutes = castItem['stepTimeoutMinutes'];
|
|
932
|
+
const stepTimeoutMinutes = {};
|
|
933
|
+
if (isPlainObject(rawStepTimeoutMinutes) === true) {
|
|
934
|
+
for (const stepKindEntry of libWorkflowStepKinds) {
|
|
935
|
+
const stepKind = stepKindEntry;
|
|
936
|
+
const rawStepTimeout = rawStepTimeoutMinutes[stepKind];
|
|
937
|
+
if (typeof rawStepTimeout === 'number'
|
|
938
|
+
&& Number.isInteger(rawStepTimeout) === true
|
|
939
|
+
&& rawStepTimeout >= 1
|
|
940
|
+
&& rawStepTimeout <= 360) {
|
|
941
|
+
Reflect.set(stepTimeoutMinutes, stepKind, rawStepTimeout);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
}
|
|
904
945
|
const rawEnvironmentSelection = castItem['environmentSelection'];
|
|
905
946
|
let environmentSelection = undefined;
|
|
906
947
|
if (isPlainObject(rawEnvironmentSelection) === true) {
|
|
@@ -933,6 +974,11 @@ export class Runner {
|
|
|
933
974
|
const deployTo = this.getNonEmptyString(rawDeployValue['to']);
|
|
934
975
|
const deployPath = this.getNonEmptyString(rawDeployValue['path']);
|
|
935
976
|
const deployArtifact = this.getNonEmptyString(rawDeployValue['artifact']);
|
|
977
|
+
const rawDeployTimeoutMinutes = rawDeployValue['timeoutMinutes'];
|
|
978
|
+
const deployTimeoutMinutes = (typeof rawDeployTimeoutMinutes === 'number'
|
|
979
|
+
&& Number.isInteger(rawDeployTimeoutMinutes) === true
|
|
980
|
+
&& rawDeployTimeoutMinutes >= 1
|
|
981
|
+
&& rawDeployTimeoutMinutes <= 360) ? rawDeployTimeoutMinutes : undefined;
|
|
936
982
|
if (deployTo === undefined || deployPath === undefined) {
|
|
937
983
|
continue;
|
|
938
984
|
}
|
|
@@ -951,6 +997,9 @@ export class Runner {
|
|
|
951
997
|
if (deployArtifact !== undefined) {
|
|
952
998
|
Reflect.set(deployTarget, 'artifact', deployArtifact);
|
|
953
999
|
}
|
|
1000
|
+
if (deployTimeoutMinutes !== undefined) {
|
|
1001
|
+
Reflect.set(deployTarget, 'timeoutMinutes', deployTimeoutMinutes);
|
|
1002
|
+
}
|
|
954
1003
|
if (deployAfter.length > 0) {
|
|
955
1004
|
Reflect.set(deployTarget, 'after', deployAfter);
|
|
956
1005
|
}
|
|
@@ -974,6 +1023,12 @@ export class Runner {
|
|
|
974
1023
|
if (timeoutMinutes !== undefined) {
|
|
975
1024
|
Reflect.set(workflow, 'timeoutMinutes', timeoutMinutes);
|
|
976
1025
|
}
|
|
1026
|
+
if (buildTimeoutMinutes !== undefined) {
|
|
1027
|
+
Reflect.set(workflow, 'buildTimeoutMinutes', buildTimeoutMinutes);
|
|
1028
|
+
}
|
|
1029
|
+
if (Object.keys(stepTimeoutMinutes).length > 0) {
|
|
1030
|
+
Reflect.set(workflow, 'stepTimeoutMinutes', stepTimeoutMinutes);
|
|
1031
|
+
}
|
|
977
1032
|
if (environmentSelection !== undefined) {
|
|
978
1033
|
Reflect.set(workflow, 'environmentSelection', environmentSelection);
|
|
979
1034
|
}
|
|
@@ -1024,6 +1079,122 @@ export class Runner {
|
|
|
1024
1079
|
}
|
|
1025
1080
|
return parsed;
|
|
1026
1081
|
}
|
|
1082
|
+
parseDockerHub(value) {
|
|
1083
|
+
if (value === undefined) {
|
|
1084
|
+
return undefined;
|
|
1085
|
+
}
|
|
1086
|
+
if (isPlainObject(value) === false) {
|
|
1087
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub" field must be an object. Skipping ...');
|
|
1088
|
+
return undefined;
|
|
1089
|
+
}
|
|
1090
|
+
const namespace = this.getNonEmptyString(value['namespace']);
|
|
1091
|
+
const repository = this.getNonEmptyString(value['repository']);
|
|
1092
|
+
if (namespace === undefined || LIB_REGEX_PATTERN_DOCKER_IMAGE_COMPONENT.test(namespace) === false) {
|
|
1093
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.namespace" field must be one lowercase Docker image-name component. Skipping ...');
|
|
1094
|
+
}
|
|
1095
|
+
if (repository === undefined || LIB_REGEX_PATTERN_DOCKER_IMAGE_COMPONENT.test(repository) === false) {
|
|
1096
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.repository" field must be one lowercase Docker image-name component. Skipping ...');
|
|
1097
|
+
}
|
|
1098
|
+
if (namespace === undefined || repository === undefined) {
|
|
1099
|
+
return undefined;
|
|
1100
|
+
}
|
|
1101
|
+
if (LIB_REGEX_PATTERN_DOCKER_IMAGE_COMPONENT.test(namespace) === false
|
|
1102
|
+
|| LIB_REGEX_PATTERN_DOCKER_IMAGE_COMPONENT.test(repository) === false) {
|
|
1103
|
+
return undefined;
|
|
1104
|
+
}
|
|
1105
|
+
const visibilityCandidate = value['visibility'];
|
|
1106
|
+
const visibility = (visibilityCandidate === 'public'
|
|
1107
|
+
|| visibilityCandidate === 'private') ? visibilityCandidate : undefined;
|
|
1108
|
+
if (visibilityCandidate !== undefined && visibility === undefined) {
|
|
1109
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.visibility" field must be "public" or "private". Skipping ...');
|
|
1110
|
+
}
|
|
1111
|
+
const categoriesValue = value['categories'];
|
|
1112
|
+
let categories = undefined;
|
|
1113
|
+
if (categoriesValue !== undefined) {
|
|
1114
|
+
if (Array.isArray(categoriesValue) === false) {
|
|
1115
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.categories" field must be an array. Skipping ...');
|
|
1116
|
+
}
|
|
1117
|
+
else if (categoriesValue.length > 3) {
|
|
1118
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.categories" field cannot contain more than 3 slugs. Skipping ...');
|
|
1119
|
+
}
|
|
1120
|
+
else {
|
|
1121
|
+
const parsedCategories = [];
|
|
1122
|
+
const seenCategories = new Set();
|
|
1123
|
+
let hasInvalidCategory = false;
|
|
1124
|
+
for (const rawCategory of categoriesValue) {
|
|
1125
|
+
const typedRawCategory = rawCategory;
|
|
1126
|
+
const category = this.getNonEmptyString(typedRawCategory);
|
|
1127
|
+
if (category === undefined || LIB_REGEX_PATTERN_DOCKER_HUB_CATEGORY_SLUG.test(category) === false) {
|
|
1128
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', `Docker Hub category slug "${String(typedRawCategory)}" is invalid. Skipping ...`);
|
|
1129
|
+
hasInvalidCategory = true;
|
|
1130
|
+
continue;
|
|
1131
|
+
}
|
|
1132
|
+
if (seenCategories.has(category) === true) {
|
|
1133
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', `Docker Hub category slug "${category}" is duplicated. Skipping ...`);
|
|
1134
|
+
hasInvalidCategory = true;
|
|
1135
|
+
continue;
|
|
1136
|
+
}
|
|
1137
|
+
seenCategories.add(category);
|
|
1138
|
+
parsedCategories.push(category);
|
|
1139
|
+
}
|
|
1140
|
+
if (hasInvalidCategory === false) {
|
|
1141
|
+
categories = parsedCategories;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
const immutableTagsValue = value['immutableTags'];
|
|
1146
|
+
let immutableTags = undefined;
|
|
1147
|
+
if (immutableTagsValue !== undefined) {
|
|
1148
|
+
if (isPlainObject(immutableTagsValue) === false) {
|
|
1149
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.immutableTags" field must be an object. Skipping ...');
|
|
1150
|
+
}
|
|
1151
|
+
else {
|
|
1152
|
+
const immutableTagsEnabled = immutableTagsValue['enabled'];
|
|
1153
|
+
const immutableTagsRulesValue = immutableTagsValue['rules'];
|
|
1154
|
+
const immutableTagsRules = [];
|
|
1155
|
+
let hasInvalidImmutableTagRule = false;
|
|
1156
|
+
if (typeof immutableTagsEnabled !== 'boolean') {
|
|
1157
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.immutableTags.enabled" field must be a boolean. Skipping ...');
|
|
1158
|
+
}
|
|
1159
|
+
if (Array.isArray(immutableTagsRulesValue) === false) {
|
|
1160
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.immutableTags.rules" field must be an array of strings. Skipping ...');
|
|
1161
|
+
hasInvalidImmutableTagRule = true;
|
|
1162
|
+
}
|
|
1163
|
+
else {
|
|
1164
|
+
for (const rawImmutableTagRule of immutableTagsRulesValue) {
|
|
1165
|
+
const typedRawImmutableTagRule = rawImmutableTagRule;
|
|
1166
|
+
const immutableTagRule = (typeof typedRawImmutableTagRule === 'string') ? typedRawImmutableTagRule : undefined;
|
|
1167
|
+
if (immutableTagRule === undefined) {
|
|
1168
|
+
this.pushError('Runner.parseDockerHub', 'dockerHub', 'The "dockerHub.immutableTags.rules" field must contain only strings. Skipping ...');
|
|
1169
|
+
hasInvalidImmutableTagRule = true;
|
|
1170
|
+
continue;
|
|
1171
|
+
}
|
|
1172
|
+
immutableTagsRules.push(immutableTagRule);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
if (typeof immutableTagsEnabled === 'boolean' && hasInvalidImmutableTagRule === false) {
|
|
1176
|
+
immutableTags = {
|
|
1177
|
+
enabled: immutableTagsEnabled,
|
|
1178
|
+
rules: immutableTagsRules,
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
const result = {
|
|
1184
|
+
namespace,
|
|
1185
|
+
repository,
|
|
1186
|
+
};
|
|
1187
|
+
if (visibility !== undefined) {
|
|
1188
|
+
result.visibility = visibility;
|
|
1189
|
+
}
|
|
1190
|
+
if (categories !== undefined) {
|
|
1191
|
+
result.categories = categories;
|
|
1192
|
+
}
|
|
1193
|
+
if (immutableTags !== undefined) {
|
|
1194
|
+
result.immutableTags = immutableTags;
|
|
1195
|
+
}
|
|
1196
|
+
return result;
|
|
1197
|
+
}
|
|
1027
1198
|
parseGithub(value) {
|
|
1028
1199
|
if (isPlainObject(value) === false) {
|
|
1029
1200
|
return undefined;
|
|
@@ -1078,6 +1249,10 @@ export class Runner {
|
|
|
1078
1249
|
return undefined;
|
|
1079
1250
|
}
|
|
1080
1251
|
const result = {};
|
|
1252
|
+
const dockerHub = this.getRecipeEntries(value['docker-hub'], libItemRecipesByCategory['docker-hub']);
|
|
1253
|
+
if (dockerHub !== undefined) {
|
|
1254
|
+
Reflect.set(result, 'docker-hub', dockerHub);
|
|
1255
|
+
}
|
|
1081
1256
|
const github = this.getRecipeEntries(value['github'], libItemRecipesByCategory['github']);
|
|
1082
1257
|
if (github !== undefined) {
|
|
1083
1258
|
result.github = github;
|