@git.zone/cli 8.7.1 → 8.8.1
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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/helpers.workflow.js +9 -8
- package/dist_ts/mod_config/index.js +33 -25
- package/dist_ts/mod_release/classes.releasejournal.js +12 -8
- package/dist_ts/mod_release/helpers.gitremote.d.ts +76 -15
- package/dist_ts/mod_release/helpers.gitremote.js +173 -38
- package/dist_ts/mod_release/helpers.releasebranch.d.ts +1 -1
- package/dist_ts/mod_release/helpers.releasebranch.js +69 -39
- package/dist_ts/mod_release/helpers.releaseline.d.ts +12 -3
- package/dist_ts/mod_release/helpers.releaseline.js +4 -1
- package/dist_ts/mod_release/helpers.releasepreparation.js +6 -6
- package/dist_ts/mod_release/helpers.releasepublication.d.ts +2 -2
- package/dist_ts/mod_release/helpers.releasepublication.js +41 -29
- package/dist_ts/mod_release/helpers.tsdockerprotocol.d.ts +4 -4
- package/dist_ts/mod_release/helpers.tsdockerprotocol.js +15 -5
- package/dist_ts/mod_release/index.js +43 -8
- package/dist_ts/plugins.d.ts +1 -1
- package/dist_ts/plugins.js +1 -1
- package/package.json +2 -2
- package/readme.md +77 -18
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/helpers.workflow.ts +8 -9
- package/ts/mod_config/index.ts +51 -25
- package/ts/mod_release/classes.releasejournal.ts +15 -8
- package/ts/mod_release/helpers.gitremote.ts +271 -58
- package/ts/mod_release/helpers.releasebranch.ts +107 -56
- package/ts/mod_release/helpers.releaseline.ts +22 -3
- package/ts/mod_release/helpers.releasepreparation.ts +4 -6
- package/ts/mod_release/helpers.releasepublication.ts +42 -30
- package/ts/mod_release/helpers.tsdockerprotocol.ts +31 -5
- package/ts/mod_release/index.ts +81 -4
- package/ts/plugins.ts +2 -0
package/ts/mod_release/index.ts
CHANGED
|
@@ -79,6 +79,7 @@ import {
|
|
|
79
79
|
assertReleaseLineVersion,
|
|
80
80
|
findDistTagPublicationRefusal,
|
|
81
81
|
getReleaseDistTag,
|
|
82
|
+
getReleaseDockerAliasPolicy,
|
|
82
83
|
isSameReleaseLine,
|
|
83
84
|
latestDistTag,
|
|
84
85
|
type IReleaseLine,
|
|
@@ -104,10 +105,12 @@ import {
|
|
|
104
105
|
} from "./helpers.releasepreparation.js";
|
|
105
106
|
import {
|
|
106
107
|
TsdockerReleaseClient,
|
|
108
|
+
TsdockerReleaseCommandError,
|
|
107
109
|
canonicalReleaseJson,
|
|
108
110
|
createReleaseQualificationRequest,
|
|
109
111
|
type ITsdockerReleaseClient,
|
|
110
112
|
type IReleaseQualificationRequest,
|
|
113
|
+
type IReleaseValidationResult,
|
|
111
114
|
} from "./helpers.tsdockerprotocol.js";
|
|
112
115
|
import {
|
|
113
116
|
assertResolvedCurrentVersion,
|
|
@@ -242,7 +245,12 @@ const runInternal = async (argvArg: any): Promise<void> => {
|
|
|
242
245
|
versionResolution.currentVersion,
|
|
243
246
|
versionResolution.version,
|
|
244
247
|
);
|
|
245
|
-
await printReleasePlan(
|
|
248
|
+
await printReleasePlan(
|
|
249
|
+
smartshellInstance,
|
|
250
|
+
workflow,
|
|
251
|
+
branchContext,
|
|
252
|
+
versionResolution,
|
|
253
|
+
);
|
|
246
254
|
if (workflow.confirmation === "plan") {
|
|
247
255
|
return;
|
|
248
256
|
}
|
|
@@ -536,7 +544,9 @@ const assertFreshReleaseCapabilities = async (
|
|
|
536
544
|
if (!tsdockerArg) {
|
|
537
545
|
throw new Error("Docker release target requires project-local tSDocker.");
|
|
538
546
|
}
|
|
539
|
-
await tsdockerArg.assertCapabilities(
|
|
547
|
+
await tsdockerArg.assertCapabilities(
|
|
548
|
+
getReleaseDockerAliasPolicy(workflowArg.line),
|
|
549
|
+
);
|
|
540
550
|
}
|
|
541
551
|
if (workflowArg.targets.includes("git") && !pushUrlArg) {
|
|
542
552
|
throw new Error(
|
|
@@ -684,6 +694,7 @@ const createDockerQualificationRequest = (
|
|
|
684
694
|
revisionArg: string,
|
|
685
695
|
): IReleaseQualificationRequest =>
|
|
686
696
|
createReleaseQualificationRequest({
|
|
697
|
+
aliasPolicy: getReleaseDockerAliasPolicy(workflowArg.line),
|
|
687
698
|
buildRegistries: workflowArg.dockerBuildRegistries,
|
|
688
699
|
cached: workflowArg.dockerCached,
|
|
689
700
|
context: workflowArg.dockerContext,
|
|
@@ -793,7 +804,9 @@ const prepareTaggedRelease = async (
|
|
|
793
804
|
const tsdocker = workflow.targets.includes("docker")
|
|
794
805
|
? new TsdockerReleaseClient(smartshell, releaseCwd)
|
|
795
806
|
: undefined;
|
|
796
|
-
await tsdocker?.assertCapabilities(
|
|
807
|
+
await tsdocker?.assertCapabilities(
|
|
808
|
+
getReleaseDockerAliasPolicy(workflow.line),
|
|
809
|
+
);
|
|
797
810
|
const journalOptions: ICreateReleaseJournalOptions = {
|
|
798
811
|
...optionsArg,
|
|
799
812
|
dockerRequest: tsdocker
|
|
@@ -1637,6 +1650,7 @@ const runReleaseResume = async (
|
|
|
1637
1650
|
);
|
|
1638
1651
|
}
|
|
1639
1652
|
const currentRequest = createReleaseQualificationRequest({
|
|
1653
|
+
aliasPolicy: getReleaseDockerAliasPolicy(resumeConfiguration.line),
|
|
1640
1654
|
buildRegistries: dockerConfiguration.dockerBuildRegistries,
|
|
1641
1655
|
cached: dockerConfiguration.dockerCached,
|
|
1642
1656
|
context: dockerConfiguration.dockerContext,
|
|
@@ -1657,7 +1671,9 @@ const runReleaseResume = async (
|
|
|
1657
1671
|
);
|
|
1658
1672
|
}
|
|
1659
1673
|
tsdocker = new TsdockerReleaseClient(smartshellInstance, paths.cwd);
|
|
1660
|
-
await tsdocker.assertCapabilities(
|
|
1674
|
+
await tsdocker.assertCapabilities(
|
|
1675
|
+
journal.docker.request.options.aliasPolicy,
|
|
1676
|
+
);
|
|
1661
1677
|
await tsdocker.validate(journal.docker.request);
|
|
1662
1678
|
}
|
|
1663
1679
|
let pnpmCapability: IPnpmReleaseCapability | undefined;
|
|
@@ -2382,7 +2398,61 @@ const describeReleaseLineDistTags = async (
|
|
|
2382
2398
|
return lines;
|
|
2383
2399
|
};
|
|
2384
2400
|
|
|
2401
|
+
/**
|
|
2402
|
+
* A line's Docker images carry only tags bound to the release version. The
|
|
2403
|
+
* plan asks tSDocker, which owns that rule, for the tags every selected
|
|
2404
|
+
* Dockerfile will publish; tSDocker refuses a tag that floats across versions,
|
|
2405
|
+
* such as `latest`, before anything is created.
|
|
2406
|
+
*/
|
|
2407
|
+
const describeReleaseLineDockerImages = async (
|
|
2408
|
+
smartshellArg: plugins.smartshell.Smartshell,
|
|
2409
|
+
workflowArg: IResolvedReleaseWorkflow,
|
|
2410
|
+
branchContextArg: IReleaseBranchContext,
|
|
2411
|
+
versionArg: string,
|
|
2412
|
+
): Promise<string[]> => {
|
|
2413
|
+
const line = workflowArg.line;
|
|
2414
|
+
if (!line || !workflowArg.targets.includes("docker")) return [];
|
|
2415
|
+
const aliasPolicy = getReleaseDockerAliasPolicy(line);
|
|
2416
|
+
const tsdocker = new TsdockerReleaseClient(
|
|
2417
|
+
smartshellArg,
|
|
2418
|
+
branchContextArg.sourceCwd,
|
|
2419
|
+
);
|
|
2420
|
+
await tsdocker.assertCapabilities(aliasPolicy);
|
|
2421
|
+
let validation: IReleaseValidationResult;
|
|
2422
|
+
try {
|
|
2423
|
+
validation = await tsdocker.validate(
|
|
2424
|
+
createDockerQualificationRequest(
|
|
2425
|
+
workflowArg,
|
|
2426
|
+
branchContextArg.sourceCwd,
|
|
2427
|
+
versionArg,
|
|
2428
|
+
branchContextArg.sourceOid,
|
|
2429
|
+
),
|
|
2430
|
+
);
|
|
2431
|
+
} catch (error) {
|
|
2432
|
+
if (error instanceof TsdockerReleaseCommandError) {
|
|
2433
|
+
throw new Error(
|
|
2434
|
+
`Release line ${line.distTag} publishes Docker images only under tags bound to ${versionArg}, and tSDocker refused the release (${error.code}): ${error.message}`,
|
|
2435
|
+
{ cause: error },
|
|
2436
|
+
);
|
|
2437
|
+
}
|
|
2438
|
+
throw error;
|
|
2439
|
+
}
|
|
2440
|
+
if (!validation.images) {
|
|
2441
|
+
throw new Error(
|
|
2442
|
+
`tSDocker did not plan the image tags of release line ${line.distTag}.`,
|
|
2443
|
+
);
|
|
2444
|
+
}
|
|
2445
|
+
return [
|
|
2446
|
+
`docker alias policy: ${aliasPolicy} (every tag is bound to ${versionArg}; floating tags such as latest are refused)`,
|
|
2447
|
+
...validation.images.map(
|
|
2448
|
+
(imageArg) =>
|
|
2449
|
+
`docker image ${imageArg.dockerfile}: ${imageArg.aliases.join(", ")}`,
|
|
2450
|
+
),
|
|
2451
|
+
];
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2385
2454
|
async function printReleasePlan(
|
|
2455
|
+
smartshellArg: plugins.smartshell.Smartshell,
|
|
2386
2456
|
workflow: IResolvedReleaseWorkflow,
|
|
2387
2457
|
branchContextArg: IReleaseBranchContext,
|
|
2388
2458
|
versionResolutionArg: IReleaseVersionResolution,
|
|
@@ -2459,6 +2529,13 @@ async function printReleasePlan(
|
|
|
2459
2529
|
`docker patterns: ${workflow.dockerPatterns.length > 0 ? workflow.dockerPatterns.join(", ") : "all Dockerfiles"}`,
|
|
2460
2530
|
);
|
|
2461
2531
|
console.log(`docker options: ${formatDockerOptions(workflow)}`);
|
|
2532
|
+
for (const line of await describeReleaseLineDockerImages(
|
|
2533
|
+
smartshellArg,
|
|
2534
|
+
workflow,
|
|
2535
|
+
branchContextArg,
|
|
2536
|
+
versionResolutionArg.version,
|
|
2537
|
+
))
|
|
2538
|
+
console.log(line);
|
|
2462
2539
|
}
|
|
2463
2540
|
console.log("");
|
|
2464
2541
|
}
|
package/ts/plugins.ts
CHANGED
|
@@ -37,8 +37,10 @@ export type {
|
|
|
37
37
|
IReleaseQualificationRequest,
|
|
38
38
|
IReleaseQualificationResult,
|
|
39
39
|
IReleaseValidationResult,
|
|
40
|
+
TReleaseAliasPolicy,
|
|
40
41
|
TReleasePromotionEvidence,
|
|
41
42
|
TReleaseProtocolCommand,
|
|
43
|
+
TReleaseProtocolFeature,
|
|
42
44
|
} from '@git.zone/tsdocker/dist_ts/interfaces/index.js';
|
|
43
45
|
|
|
44
46
|
// Create smartfs instance for filesystem operations
|