@wtf/release-oci 2.1.0 → 4.0.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/README.md +101 -79
- package/dist/ecosystem.d.ts +76 -17
- package/dist/ecosystem.d.ts.map +1 -1
- package/dist/ecosystem.js +117 -8
- package/dist/ecosystem.js.map +1 -1
- package/dist/errors.d.ts +9 -9
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -9
- package/dist/errors.js.map +1 -1
- package/dist/images.d.ts +7 -7
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js +9 -9
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +14 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -11
- package/dist/index.js.map +1 -1
- package/dist/pages.d.ts +57 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +61 -0
- package/dist/pages.js.map +1 -0
- package/dist/publish.d.ts +61 -19
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +100 -49
- package/dist/publish.js.map +1 -1
- package/dist/tags.d.ts +9 -22
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +24 -48
- package/dist/tags.js.map +1 -1
- package/package.json +9 -11
- package/dist/registry.d.ts +0 -60
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -56
- package/dist/registry.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# @wtf/release-oci
|
|
2
2
|
|
|
3
|
-
Releases the OCI images of a repo
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Releases the OCI images of a repo, with no release tool and no rebuild. A pipeline builds and tests
|
|
4
|
+
an image; a release copies that tested image, by its digest, to the tag of its version in the
|
|
5
|
+
registry, and points the tags that move at it, so the bytes released are the bytes tested. This
|
|
6
|
+
library reads the images of a repo, finds the tested image of each, and copies it by
|
|
7
7
|
[crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md). It is the
|
|
8
8
|
library of [`@wtf/semantic-release-oci`](../semantic-release-oci/README.md), with no dependency on
|
|
9
|
-
semantic-release; each function runs `git` and `crane` by the
|
|
10
|
-
[`@wtf/release
|
|
9
|
+
semantic-release nor on the trains; each function runs `git` and `crane` by the platform its caller
|
|
10
|
+
gives it, in the folder of the repo, as [`@wtf/release`](../release/README.md) has them.
|
|
11
11
|
|
|
12
12
|
## The ecosystem
|
|
13
13
|
|
|
14
|
-
Its default export is the ecosystem of OCI images, `ociEcosystem` of `./ecosystem`,
|
|
15
|
-
of [`@wtf/release
|
|
14
|
+
Its default export is the ecosystem of OCI images, `ociEcosystem` of `./ecosystem`, a
|
|
15
|
+
`ReleasingEcosystem` of [`@wtf/release/contract`](../release/README.md), which a config names in
|
|
16
16
|
`ecosystems` as `'@wtf/release-oci'`. The trains then read the images of the repo as they read npm
|
|
17
17
|
packages and crates: which train holds each, the order of the trains, and the checks of a release
|
|
18
18
|
([Ecosystems](../docs/guides/ecosystems.md)).
|
|
@@ -29,79 +29,100 @@ packages and crates: which train holds each, the order of the trains, and the ch
|
|
|
29
29
|
- `satisfies` takes a tag of the one version it names.
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
|
+
import type { ReleasePlatform, RepoContext } from '@wtf/release'
|
|
32
33
|
import oci from '@wtf/release-oci'
|
|
33
|
-
import type { System } from '@wtf/release-system/system'
|
|
34
34
|
|
|
35
35
|
oci.resolve('0.0.0', '1.4.0') // '1.4.0'
|
|
36
36
|
oci.satisfies('1.4.0', '1.4.0') // true
|
|
37
37
|
|
|
38
38
|
/** The images of the repo at the tag of a release, as the trains read them. */
|
|
39
|
-
export const imagesAt = (
|
|
39
|
+
export const imagesAt = (repo: RepoContext<ReleasePlatform>, tag: string) =>
|
|
40
|
+
oci.packages({ ...repo, ref: tag })
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
No version is written into git: the tags of the registry are the versions. A
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
## A release of images
|
|
44
|
+
|
|
45
|
+
No version is written into git: the tags of the registry are the versions. A driver, as `runStep`
|
|
46
|
+
of `@wtf/release/driver`, runs the steps of the ecosystem over the images of the plan it gives,
|
|
47
|
+
`plan.own`, each with the same options, `OciOptions`:
|
|
48
|
+
|
|
49
|
+
| Option | What it is |
|
|
50
|
+
| ----------- | ------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `moving` | The tags that move to the version, as `['1.4', '1']` or `['12.12', 'latest']`: `[]` of none |
|
|
52
|
+
| `source` | The tested image of each: its `repository`, `{image}` the image's own, and its `tag` |
|
|
53
|
+
| `platforms` | The platforms each tested image must be of, as `linux/amd64`: any by default |
|
|
54
|
+
| `crane` | The command of crane: `crane` by default |
|
|
55
|
+
|
|
56
|
+
Each step:
|
|
57
|
+
|
|
58
|
+
- `verify` checks that the version and each tag of `moving` is a tag of an image (`EOCIVERSION`),
|
|
59
|
+
and that each image has a repository (`EOCIIMAGE`). It asks the registry nothing.
|
|
60
|
+
- `smoke` finds the tested image of each by its digest (`crane digest`), and the platforms of its
|
|
61
|
+
index (`crane manifest`). A source the registry has not, or of fewer platforms than `platforms`
|
|
62
|
+
names, fails (`EOCISMOKE`).
|
|
63
|
+
- `publish` smokes each image, then copies the digest of its tested image to the tag of the version,
|
|
64
|
+
`crane copy <source>@<digest> <image>:<version>`, which mounts each blob of the source's repository
|
|
65
|
+
rather than moving it. It gives each image, a `Released` of `@wtf/release/forge`: of its page on
|
|
66
|
+
Docker Hub or Quay, which its URL alone names; else of its registry, of the type `container`,
|
|
67
|
+
whose page the forge of the release knows, as the container registry of GitLab or `ghcr.io` of
|
|
68
|
+
GitHub (`./pages`). An image is linked where it lives, never uploaded.
|
|
69
|
+
- `move` points each tag of `moving` at the digest the registry has of the version,
|
|
70
|
+
`crane copy <image>@<digest> <image>:<tag>`. A version the registry has not fails (`EOCIMOVE`).
|
|
71
|
+
|
|
72
|
+
The tag of the version is copied once: a registry that has it at the same digest is skipped, so a
|
|
73
|
+
release that stopped part way is finished by running it again, and at another digest is refused
|
|
74
|
+
(`EOCIRETAG`), as a released version never moves. The tags that move are copied every time. A dry
|
|
75
|
+
run, `release.dryRun`, asks the registry, and copies nothing. The ecosystem
|
|
76
|
+
writes nothing into git, so it has no `prepare`.
|
|
60
77
|
|
|
61
|
-
|
|
78
|
+
```ts
|
|
79
|
+
import type { Plan, Release } from '@wtf/release/contract'
|
|
80
|
+
import { runStep } from '@wtf/release/driver'
|
|
81
|
+
import oci from '@wtf/release-oci'
|
|
62
82
|
|
|
63
|
-
`
|
|
64
|
-
|
|
83
|
+
/** The images of `plan` released as `12.12-wtf.1`, `12.12` and `latest`, of a tested image. */
|
|
84
|
+
export async function release(of: Release, plan: Plan, tag: string) {
|
|
85
|
+
const plans = new Map([['oci', plan]])
|
|
86
|
+
const options = { moving: ['12.12', 'latest'], source: { repository: '{image}/snapshot', tag } }
|
|
87
|
+
const ecosystems = [[oci, options]] as const
|
|
88
|
+
await runStep(of, plans, ecosystems, 'verify')
|
|
89
|
+
const { released } = await runStep(of, plans, ecosystems, 'publish')
|
|
90
|
+
await runStep(of, plans, ecosystems, 'move')
|
|
91
|
+
return released
|
|
92
|
+
}
|
|
93
|
+
```
|
|
65
94
|
|
|
66
|
-
|
|
67
|
-
| -------------- | ------------------- |
|
|
68
|
-
| `1.4.2` | `1.4.2`, `1.4`, `1` |
|
|
69
|
-
| `0.3.1` | `0.3.1`, `0.3` |
|
|
70
|
-
| `8.0.0-next.1` | `8.0.0-next.1` |
|
|
95
|
+
## The tags of a release
|
|
71
96
|
|
|
72
|
-
|
|
73
|
-
|
|
97
|
+
The ecosystem takes the tags of a release as they are given: the version, the tag that is copied
|
|
98
|
+
once and never moved, and `moving`, each tag copied on every run, `[]` of none. It derives none: a
|
|
99
|
+
release of a semver version, as the plugin makes it, moves its minor and its major, and a release of
|
|
100
|
+
a version that is no semver, as `12.12-wtf.1` of an image of Debian 12.12, names its own. Each is a
|
|
101
|
+
tag an image can have, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none given twice, as `checkReleaseTags`
|
|
102
|
+
of `./tags` checks.
|
|
74
103
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
`releaseTagsOf` gives those of a semver version, as the plugin passes them, and a release of a
|
|
78
|
-
version that is no semver, as `12.12-wtf.1` of an image of Debian 12.12, names its own. Each is a tag
|
|
79
|
-
an image can have, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none given twice, as `checkReleaseTags`
|
|
80
|
-
checks before anything is asked of the registry.
|
|
104
|
+
The functions the steps build on take each image of its repository and its source, of no plan:
|
|
105
|
+
`smokeImages`, `publishImages` and `moveImages` of `./publish`.
|
|
81
106
|
|
|
82
107
|
```ts
|
|
83
|
-
import {
|
|
84
|
-
import
|
|
108
|
+
import type { RepoPlatform } from '@wtf/release'
|
|
109
|
+
import { moveImages, publishImages } from '@wtf/release-oci/publish'
|
|
85
110
|
|
|
86
111
|
/** The base image of Debian 12.12, its first build of ours, as `12.12-wtf.1`, `12.12` and `latest`. */
|
|
87
|
-
export
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
112
|
+
export async function release(platform: RepoPlatform, source: string) {
|
|
113
|
+
const repository = 'registry.gitlab.com/acme/images/base'
|
|
114
|
+
await publishImages({
|
|
115
|
+
context: { platform },
|
|
116
|
+
images: [{ repository, source: { repository, tag: source } }],
|
|
117
|
+
version: '12.12-wtf.1'
|
|
118
|
+
})
|
|
119
|
+
await moveImages({
|
|
120
|
+
context: { platform },
|
|
121
|
+
repositories: [repository],
|
|
96
122
|
version: '12.12-wtf.1',
|
|
97
123
|
moving: ['12.12', 'latest']
|
|
98
124
|
})
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
```ts
|
|
102
|
-
import { tagsOfRelease } from '@wtf/release-oci/tags'
|
|
103
|
-
|
|
104
|
-
export const tags = tagsOfRelease('1.4.2') // ['1.4.2', '1.4', '1']
|
|
125
|
+
}
|
|
105
126
|
```
|
|
106
127
|
|
|
107
128
|
## The version in an image
|
|
@@ -114,24 +135,25 @@ build as an argument of its own.
|
|
|
114
135
|
|
|
115
136
|
## Subpaths
|
|
116
137
|
|
|
117
|
-
| Subpath | What it is
|
|
118
|
-
| ------------- |
|
|
119
|
-
| `.` | `OciImage`, and the ecosystem as the default export
|
|
120
|
-
| `./ecosystem` | `ociEcosystem`, `packagesOfImages`, `packagesOfRepo`, `resolveTag`, `satisfiesTag` |
|
|
121
|
-
| `./images` | `readImages`, `imagesAt`, `imagesOf`, `imageDirOf`, `repositoryOf`
|
|
122
|
-
| `./tags` | `
|
|
123
|
-
| `./publish` | `smokeImages`, `publishImages`, `digestOf`, `platformsOf`
|
|
124
|
-
| `./
|
|
125
|
-
| `./errors` | `OciError`, `OCI_ERRORS`
|
|
138
|
+
| Subpath | What it is |
|
|
139
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
140
|
+
| `.` | `OciImage`, and the ecosystem as the default export |
|
|
141
|
+
| `./ecosystem` | `ociEcosystem`, `OciOptions`, `repositoriesOf`, `packagesOfImages`, `packagesOfRepo`, `resolveTag`, `satisfiesTag` |
|
|
142
|
+
| `./images` | `readImages`, `imagesAt`, `imagesOf`, `imageDirOf`, `repositoryOf` |
|
|
143
|
+
| `./tags` | `checkReleaseTags`, `isImageTag` |
|
|
144
|
+
| `./publish` | `smokeImages`, `publishImages`, `moveImages`, `digestOf`, `platformsOf` |
|
|
145
|
+
| `./pages` | `releasedImage`, `imagePageOf`, `repositoryParts` |
|
|
146
|
+
| `./errors` | `OciError`, `OCI_ERRORS` |
|
|
126
147
|
|
|
127
148
|
## Errors
|
|
128
149
|
|
|
129
|
-
| Code | Means
|
|
130
|
-
| --------------- |
|
|
131
|
-
| `EOCIECOSYSTEM` | `ecosystems` lists neither `@wtf/semantic-release-oci/ecosystem` nor this
|
|
132
|
-
| `EOCIIMAGE` | An image has no repository: neither `image` nor `CI_REGISTRY_IMAGE` names one
|
|
133
|
-
| `EOCISOURCE` | The tested image has no tag: neither `sourceTag` nor `CI_COMMIT_REF_SLUG`
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
150
|
+
| Code | Means |
|
|
151
|
+
| --------------- | --------------------------------------------------------------------------------------- |
|
|
152
|
+
| `EOCIECOSYSTEM` | `ecosystems` lists neither `@wtf/semantic-release-oci/ecosystem` nor this |
|
|
153
|
+
| `EOCIIMAGE` | An image has no repository: neither `image` nor `CI_REGISTRY_IMAGE` names one |
|
|
154
|
+
| `EOCISOURCE` | The tested image has no tag: neither `sourceTag` nor `CI_COMMIT_REF_SLUG`, nor `source` |
|
|
155
|
+
| `EOCIVERSION` | The version, or a tag that moves, is no tag of an image, or a tag is given twice |
|
|
156
|
+
| `EOCISMOKE` | The registry has not the tested image, or crane cannot ask it |
|
|
157
|
+
| `EOCIRETAG` | The registry has the version already, at another digest |
|
|
158
|
+
| `EOCITAG` | crane cannot copy the tested image to a tag |
|
|
159
|
+
| `EOCIMOVE` | The registry has not the version, which the tags that move would point at |
|
package/dist/ecosystem.d.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The ecosystem of OCI images ({@link ociEcosystem}),
|
|
3
|
-
* of the package, which a config names in
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* of the repo. A range of an image is a tag: a release
|
|
8
|
-
* ({@link resolveTag}), which takes that version alone
|
|
2
|
+
* The ecosystem of OCI images ({@link ociEcosystem}), a `ReleasingEcosystem` of
|
|
3
|
+
* `@wtf/release/contract`, and the default export of the package, which a config names in
|
|
4
|
+
* `ecosystems` as `'@wtf/release-oci'`. Its read side: the images of the repo, each folder of a file
|
|
5
|
+
* an image is built of that git tracks ({@link packagesOfRepo}), of the working tree or of a commit;
|
|
6
|
+
* a repo of none has none. An image names no other image of the repo as a dependency: a `FROM` or a
|
|
7
|
+
* base pins a tag of a registry, not a package of the repo. A range of an image is a tag: a release
|
|
8
|
+
* publishes the version itself ({@link resolveTag}), which takes that version alone
|
|
9
|
+
* ({@link satisfiesTag}).
|
|
10
|
+
*
|
|
11
|
+
* Its steps, each over the images of the plan it is given, of its options ({@link OciOptions}):
|
|
12
|
+
*
|
|
13
|
+
* | Step | What it does |
|
|
14
|
+
* | --------- | -------------------------------------------------------------------------- |
|
|
15
|
+
* | `verify` | checks the version and the tags that move, and the repository of each |
|
|
16
|
+
* | `smoke` | finds the tested image of each by its digest, of the platforms asked |
|
|
17
|
+
* | `publish` | copies the tested image of each, by its digest, to the tag of the version |
|
|
18
|
+
* | `move` | points the tags that move at the digest of the version |
|
|
19
|
+
*
|
|
20
|
+
* It writes nothing into git, so it has no `prepare`: the tags of the registry are the versions.
|
|
9
21
|
*
|
|
10
22
|
* ```js
|
|
11
23
|
* // release.config.mjs
|
|
@@ -21,15 +33,16 @@
|
|
|
21
33
|
* @packageDocumentation
|
|
22
34
|
* @module @wtf/release-oci/ecosystem
|
|
23
35
|
*/
|
|
24
|
-
import type {
|
|
36
|
+
import type { ReleasingEcosystem } from '@wtf/release/contract';
|
|
37
|
+
import type { EcosystemContext, Package } from '@wtf/release/ecosystem';
|
|
25
38
|
import type { OciImage } from './index.ts';
|
|
26
|
-
/** An image as
|
|
39
|
+
/** An image as a release reads it: a package of the ecosystem, and the image it is of. */
|
|
27
40
|
export interface OciPackage extends Package {
|
|
28
41
|
/** The image, as `readImages` of `./images` gives it. */
|
|
29
42
|
readonly image: OciImage;
|
|
30
43
|
}
|
|
31
44
|
/**
|
|
32
|
-
* The images of the repo as
|
|
45
|
+
* The images of the repo as a release reads them: each a package named by its repository, or by its
|
|
33
46
|
* folder where the environment names no registry image; of its folder and the file it is built of;
|
|
34
47
|
* published, as every image a pipeline builds is; and of no dependency.
|
|
35
48
|
*
|
|
@@ -38,7 +51,7 @@ export interface OciPackage extends Package {
|
|
|
38
51
|
*/
|
|
39
52
|
export declare function packagesOfImages(images: readonly OciImage[]): OciPackage[];
|
|
40
53
|
/**
|
|
41
|
-
* The tag a release publishes of an image of `version`, the
|
|
54
|
+
* The tag a release publishes of an image of `version`, the version of the release: the version
|
|
42
55
|
* itself, as `1.4.0`. No image of the repo names another as a dependency, so a range is never read
|
|
43
56
|
* of a manifest.
|
|
44
57
|
*
|
|
@@ -49,7 +62,7 @@ export declare function packagesOfImages(images: readonly OciImage[]): OciPackag
|
|
|
49
62
|
export declare const resolveTag: (_range: string, version: string) => string;
|
|
50
63
|
/**
|
|
51
64
|
* Whether `version` is the one `tag` names: a tag of an image names one version, and a moving tag,
|
|
52
|
-
* as `1`, is no range
|
|
65
|
+
* as `1`, is no range a release reads.
|
|
53
66
|
*
|
|
54
67
|
* @param tag - A tag, as `1.4.0`.
|
|
55
68
|
* @param version - A version, as `1.4.0`.
|
|
@@ -57,18 +70,64 @@ export declare const resolveTag: (_range: string, version: string) => string;
|
|
|
57
70
|
*/
|
|
58
71
|
export declare const satisfiesTag: (tag: string, version: string) => boolean;
|
|
59
72
|
/**
|
|
60
|
-
* The images of the repo of `context` as
|
|
73
|
+
* The images of the repo of `context` as a release reads them, of the commit `ref` where it names
|
|
61
74
|
* one, else of the working tree.
|
|
62
75
|
*
|
|
63
|
-
* @param context - The folder of the repo,
|
|
76
|
+
* @param context - The folder of the repo, the platform git runs by, and the commit.
|
|
64
77
|
* @returns The packages, one of each image.
|
|
65
78
|
* @throws `EGIT` of a commit git has not.
|
|
66
79
|
*/
|
|
67
80
|
export declare function packagesOfRepo(context: EcosystemContext): Promise<OciPackage[]>;
|
|
81
|
+
/** The tested image of each image of a release: where the pipeline that tested it pushed it. */
|
|
82
|
+
export interface OciSourceOptions {
|
|
83
|
+
/**
|
|
84
|
+
* The repository of the tested image of each image, `{image}` its repository, as
|
|
85
|
+
* `{image}/snapshot`.
|
|
86
|
+
*/
|
|
87
|
+
readonly repository: string;
|
|
88
|
+
/** Its tag, as `base-v1-4-2`, the snapshot of the pipeline of the tag of the release. */
|
|
89
|
+
readonly tag: string;
|
|
90
|
+
}
|
|
91
|
+
/** The options of the ecosystem of OCI images, which a driver gives each step. */
|
|
92
|
+
export interface OciOptions {
|
|
93
|
+
/**
|
|
94
|
+
* The tags that move to the version of the release, as `['1.4', '1']` of `1.4.2`, or
|
|
95
|
+
* `['12.12', 'latest']` of `12.12-wtf.1`: `[]` of none. The ecosystem derives none: its caller
|
|
96
|
+
* names them by its own rules.
|
|
97
|
+
*/
|
|
98
|
+
readonly moving: readonly string[];
|
|
99
|
+
/** The tested image of each image, which `smoke` finds and `publish` copies. */
|
|
100
|
+
readonly source?: OciSourceOptions | undefined;
|
|
101
|
+
/** The platforms each tested image must be of, as `linux/amd64`: any by default. */
|
|
102
|
+
readonly platforms?: readonly string[] | undefined;
|
|
103
|
+
/** The command of crane, by its name on the path or its path: `crane` by default. */
|
|
104
|
+
readonly crane?: string | undefined;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The repository of each image of `packages`. Throws `EOCIIMAGE`, together, of each image of none.
|
|
108
|
+
*
|
|
109
|
+
* @param packages - The images, as the ecosystem gives them.
|
|
110
|
+
* @returns The repository of each, in their order.
|
|
111
|
+
*/
|
|
112
|
+
export declare function repositoriesOf(packages: readonly OciPackage[]): string[];
|
|
68
113
|
/**
|
|
69
114
|
* The ecosystem of OCI images: its packages, the images of the repo, of the working tree or of a
|
|
70
|
-
* commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag});
|
|
71
|
-
*
|
|
115
|
+
* commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag}); a tag of
|
|
116
|
+
* one version ({@link satisfiesTag}); and the steps of a release of its images, each there:
|
|
117
|
+
*
|
|
118
|
+
* - `verify` checks that the version and each tag that moves is a tag of an image, none given twice
|
|
119
|
+
* (`EOCIVERSION`), and that each image has a repository (`EOCIIMAGE`), together; it asks the
|
|
120
|
+
* registry nothing;
|
|
121
|
+
* - `smoke` finds the tested image of each image by its digest, of the platforms of `platforms`
|
|
122
|
+
* (`EOCISMOKE`), as `smokeImages` of `./publish` does;
|
|
123
|
+
* - `publish` copies the tested image of each image, by its digest, to the tag of the version,
|
|
124
|
+
* skipped of a registry that has it at the same digest and refused at another (`EOCIRETAG`), as
|
|
125
|
+
* `publishImages` of `./publish` does; and gives each image, by its repository, of its page on
|
|
126
|
+
* Docker Hub or Quay, else of its registry, whose forge the links of the release ask its page
|
|
127
|
+
* (`releasedImage` of `./pages`); a dry run asks the registry, and copies nothing;
|
|
128
|
+
* - `move` points the tags of `moving` of each image at the digest the registry has of the version,
|
|
129
|
+
* as `moveImages` of `./publish` does (`EOCIMOVE`), and gives each image it moved; a dry run asks
|
|
130
|
+
* the registry, and copies nothing.
|
|
72
131
|
*/
|
|
73
|
-
export declare const ociEcosystem:
|
|
132
|
+
export declare const ociEcosystem: ReleasingEcosystem<OciOptions, OciPackage, 'verify' | 'smoke' | 'move'>;
|
|
74
133
|
//# sourceMappingURL=ecosystem.d.ts.map
|
package/dist/ecosystem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecosystem.d.ts","sourceRoot":"","sources":["../src/ecosystem.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ecosystem.d.ts","sourceRoot":"","sources":["../src/ecosystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAiB,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAIvE,OAAO,KAAK,EAAE,QAA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BAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CA6C9F,CAAA"}
|
package/dist/ecosystem.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { throwAll } from '@wtf/release/errors';
|
|
2
|
+
import { OciError } from "./errors.js";
|
|
1
3
|
import { imagesAt, readImages } from "./images.js";
|
|
4
|
+
import { moveImages, publishImages, smokeImages } from "./publish.js";
|
|
5
|
+
import { releasedImage } from "./pages.js";
|
|
6
|
+
import { checkReleaseTags } from "./tags.js";
|
|
2
7
|
/**
|
|
3
|
-
* The images of the repo as
|
|
8
|
+
* The images of the repo as a release reads them: each a package named by its repository, or by its
|
|
4
9
|
* folder where the environment names no registry image; of its folder and the file it is built of;
|
|
5
10
|
* published, as every image a pipeline builds is; and of no dependency.
|
|
6
11
|
*
|
|
@@ -18,7 +23,7 @@ export function packagesOfImages(images) {
|
|
|
18
23
|
}));
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
|
-
* The tag a release publishes of an image of `version`, the
|
|
26
|
+
* The tag a release publishes of an image of `version`, the version of the release: the version
|
|
22
27
|
* itself, as `1.4.0`. No image of the repo names another as a dependency, so a range is never read
|
|
23
28
|
* of a manifest.
|
|
24
29
|
*
|
|
@@ -29,7 +34,7 @@ export function packagesOfImages(images) {
|
|
|
29
34
|
export const resolveTag = (_range, version) => version;
|
|
30
35
|
/**
|
|
31
36
|
* Whether `version` is the one `tag` names: a tag of an image names one version, and a moving tag,
|
|
32
|
-
* as `1`, is no range
|
|
37
|
+
* as `1`, is no range a release reads.
|
|
33
38
|
*
|
|
34
39
|
* @param tag - A tag, as `1.4.0`.
|
|
35
40
|
* @param version - A version, as `1.4.0`.
|
|
@@ -37,25 +42,129 @@ export const resolveTag = (_range, version) => version;
|
|
|
37
42
|
*/
|
|
38
43
|
export const satisfiesTag = (tag, version) => tag.replace(/^v/, '') === version.replace(/^v/, '');
|
|
39
44
|
/**
|
|
40
|
-
* The images of the repo of `context` as
|
|
45
|
+
* The images of the repo of `context` as a release reads them, of the commit `ref` where it names
|
|
41
46
|
* one, else of the working tree.
|
|
42
47
|
*
|
|
43
|
-
* @param context - The folder of the repo,
|
|
48
|
+
* @param context - The folder of the repo, the platform git runs by, and the commit.
|
|
44
49
|
* @returns The packages, one of each image.
|
|
45
50
|
* @throws `EGIT` of a commit git has not.
|
|
46
51
|
*/
|
|
47
52
|
export async function packagesOfRepo(context) {
|
|
48
53
|
return packagesOfImages(context.ref === undefined ? await readImages(context) : await imagesAt(context.ref, context));
|
|
49
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* The repository of each image of `packages`. Throws `EOCIIMAGE`, together, of each image of none.
|
|
57
|
+
*
|
|
58
|
+
* @param packages - The images, as the ecosystem gives them.
|
|
59
|
+
* @returns The repository of each, in their order.
|
|
60
|
+
*/
|
|
61
|
+
export function repositoriesOf(packages) {
|
|
62
|
+
const errors = [];
|
|
63
|
+
const repositories = packages.flatMap(({ image: { dir, repository } }) => {
|
|
64
|
+
if (repository !== undefined)
|
|
65
|
+
return [repository];
|
|
66
|
+
errors.push(new OciError('EOCIIMAGE', `The image of ${dir} has no repository: the environment its images were read of names no registry image of the project, \`CI_REGISTRY_IMAGE\`.`, 'Read the images in a pipeline of GitLab, which gives `CI_REGISTRY_IMAGE`, or give `readImages` of `@wtf/release-oci/images` the registry image of the project, as `registry.gitlab.com/acme/images`.'));
|
|
67
|
+
return [];
|
|
68
|
+
});
|
|
69
|
+
throwAll(errors);
|
|
70
|
+
return repositories;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The images of `plan`, each of its tested image, of the source of `options`. Throws `EOCIIMAGE` of
|
|
74
|
+
* an image of no repository, and `EOCISOURCE` of options of no source.
|
|
75
|
+
*
|
|
76
|
+
* @param plan - What the release is of.
|
|
77
|
+
* @param options - The options of the ecosystem.
|
|
78
|
+
* @returns Each image, of its source.
|
|
79
|
+
*/
|
|
80
|
+
function imagesToPublish(plan, options) {
|
|
81
|
+
const repositories = repositoriesOf(plan.own);
|
|
82
|
+
const { source } = options;
|
|
83
|
+
if (source === undefined)
|
|
84
|
+
throw new OciError('EOCISOURCE', 'The tested image of the release is not named: the options of the ecosystem give no `source`.', 'Give the repository and the tag the pipeline pushes the tested image of each image as: the repository `{image}/snapshot`, `{image}` its repository, and the tag `base-v1-4-2`.');
|
|
85
|
+
return repositories.map((repository) => ({
|
|
86
|
+
repository,
|
|
87
|
+
source: { repository: source.repository.replaceAll('{image}', repository), tag: source.tag }
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The errors `check` throws: each of an `AggregateError`, or the one; none of a check that passes.
|
|
92
|
+
*
|
|
93
|
+
* @param check - The check.
|
|
94
|
+
* @returns Its errors.
|
|
95
|
+
*/
|
|
96
|
+
function faultsOf(check) {
|
|
97
|
+
try {
|
|
98
|
+
check();
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return error instanceof AggregateError ? error.errors : [error];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Where crane runs of a release and its options. */
|
|
106
|
+
const craneOf = (release, options) => ({
|
|
107
|
+
platform: release.platform,
|
|
108
|
+
crane: options.crane
|
|
109
|
+
});
|
|
50
110
|
/**
|
|
51
111
|
* The ecosystem of OCI images: its packages, the images of the repo, of the working tree or of a
|
|
52
|
-
* commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag});
|
|
53
|
-
*
|
|
112
|
+
* commit ({@link packagesOfRepo}); a tag published as the version ({@link resolveTag}); a tag of
|
|
113
|
+
* one version ({@link satisfiesTag}); and the steps of a release of its images, each there:
|
|
114
|
+
*
|
|
115
|
+
* - `verify` checks that the version and each tag that moves is a tag of an image, none given twice
|
|
116
|
+
* (`EOCIVERSION`), and that each image has a repository (`EOCIIMAGE`), together; it asks the
|
|
117
|
+
* registry nothing;
|
|
118
|
+
* - `smoke` finds the tested image of each image by its digest, of the platforms of `platforms`
|
|
119
|
+
* (`EOCISMOKE`), as `smokeImages` of `./publish` does;
|
|
120
|
+
* - `publish` copies the tested image of each image, by its digest, to the tag of the version,
|
|
121
|
+
* skipped of a registry that has it at the same digest and refused at another (`EOCIRETAG`), as
|
|
122
|
+
* `publishImages` of `./publish` does; and gives each image, by its repository, of its page on
|
|
123
|
+
* Docker Hub or Quay, else of its registry, whose forge the links of the release ask its page
|
|
124
|
+
* (`releasedImage` of `./pages`); a dry run asks the registry, and copies nothing;
|
|
125
|
+
* - `move` points the tags of `moving` of each image at the digest the registry has of the version,
|
|
126
|
+
* as `moveImages` of `./publish` does (`EOCIMOVE`), and gives each image it moved; a dry run asks
|
|
127
|
+
* the registry, and copies nothing.
|
|
54
128
|
*/
|
|
55
129
|
export const ociEcosystem = {
|
|
56
130
|
name: 'oci',
|
|
57
131
|
packages: packagesOfRepo,
|
|
58
132
|
resolve: resolveTag,
|
|
59
|
-
satisfies: satisfiesTag
|
|
133
|
+
satisfies: satisfiesTag,
|
|
134
|
+
async verify(release, plan, options) {
|
|
135
|
+
throwAll([
|
|
136
|
+
...faultsOf(() => checkReleaseTags({ version: release.version, moving: options.moving })),
|
|
137
|
+
...faultsOf(() => repositoriesOf(plan.own))
|
|
138
|
+
]);
|
|
139
|
+
},
|
|
140
|
+
async smoke(release, plan, options) {
|
|
141
|
+
await smokeImages(imagesToPublish(plan, options), craneOf(release, options), options.platforms ?? []);
|
|
142
|
+
},
|
|
143
|
+
async publish(release, plan, options) {
|
|
144
|
+
const published = await publishImages({
|
|
145
|
+
context: craneOf(release, options),
|
|
146
|
+
images: imagesToPublish(plan, options),
|
|
147
|
+
version: release.version,
|
|
148
|
+
platforms: options.platforms,
|
|
149
|
+
dryRun: release.dryRun,
|
|
150
|
+
log: release.log
|
|
151
|
+
});
|
|
152
|
+
return published.map(({ repository, version }) => releasedImage(repository, version));
|
|
153
|
+
},
|
|
154
|
+
async move(release, plan, options) {
|
|
155
|
+
const moved = await moveImages({
|
|
156
|
+
context: craneOf(release, options),
|
|
157
|
+
repositories: repositoriesOf(plan.own),
|
|
158
|
+
version: release.version,
|
|
159
|
+
moving: options.moving,
|
|
160
|
+
dryRun: release.dryRun,
|
|
161
|
+
log: release.log
|
|
162
|
+
});
|
|
163
|
+
return moved.map(({ repository }) => ({
|
|
164
|
+
ecosystem: 'oci',
|
|
165
|
+
name: repository,
|
|
166
|
+
version: release.version
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
60
169
|
};
|
|
61
170
|
//# sourceMappingURL=ecosystem.js.map
|
package/dist/ecosystem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecosystem.js","sourceRoot":"","sources":["../src/ecosystem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ecosystem.js","sourceRoot":"","sources":["../src/ecosystem.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAGL,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAO5C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA2B;IAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5B,IAAI,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG;QACnC,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,EAAE;QAChB,KAAK;KACN,CAAC,CAAC,CAAA;AACL,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E,OAAO,CAAC,GAAG;SACjB,CAAC,CAAA;QACF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;YACpC,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CAAC,CAAA;IACL,CAAC;CACF,CAAA"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What the release of OCI images throws: {@link OciError}, a `ReleaseError` of
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `@wtf/release-trains/errors`.
|
|
2
|
+
* What the release of OCI images throws: {@link OciError}, a `ReleaseError` of `@wtf/release/errors`
|
|
3
|
+
* of the codes of {@link OCI_ERRORS}, beside the codes of the options of a plugin, its
|
|
4
|
+
* `RELEASE_ERRORS` (`EOPTIONS`). What is the same of every ecosystem, as the plan of a release, is
|
|
5
|
+
* its driver's own.
|
|
7
6
|
*
|
|
8
7
|
* @packageDocumentation
|
|
9
8
|
* @module @wtf/release-oci/errors
|
|
10
9
|
*/
|
|
11
|
-
import { ReleaseError } from '@wtf/release
|
|
10
|
+
import { ReleaseError } from '@wtf/release/errors';
|
|
12
11
|
/** The codes of the errors of the OCI images, each with what it means. */
|
|
13
12
|
export declare const OCI_ERRORS: {
|
|
14
13
|
readonly EOCIECOSYSTEM: "The `ecosystems` of the config lists neither `@wtf/semantic-release-oci/ecosystem` nor `@wtf/release-oci`, so the trains read no image.";
|
|
15
14
|
readonly EOCIIMAGE: "The repository of an image cannot be named: neither the option `image` nor `CI_REGISTRY_IMAGE` of the environment gives one.";
|
|
16
|
-
readonly EOCISOURCE: "The tested image of a release cannot be named: neither the option `sourceTag` nor `CI_COMMIT_REF_SLUG` of the environment gives its tag
|
|
15
|
+
readonly EOCISOURCE: "The tested image of a release cannot be named: neither the option `sourceTag` nor `CI_COMMIT_REF_SLUG` of the environment gives its tag, or the options of the ecosystem give no `source`.";
|
|
16
|
+
readonly EOCIVERSION: "The version of a release, or a tag that moves with it, is no tag of an image, or a tag is given twice.";
|
|
17
17
|
readonly EOCISMOKE: "The registry has not the tested image of a release, or crane cannot ask it: there is nothing to copy to the tags of the release.";
|
|
18
18
|
readonly EOCIRETAG: "The registry has the full version of a release already, at another digest: a released version is never moved.";
|
|
19
19
|
readonly EOCITAG: "crane cannot copy the tested image to a tag of the release.";
|
|
20
|
-
readonly
|
|
20
|
+
readonly EOCIMOVE: "The registry has not the version of a release, so the tags that move with it have nothing to point at.";
|
|
21
21
|
};
|
|
22
22
|
/** A code of {@link OCI_ERRORS}. */
|
|
23
23
|
export type OciErrorCode = keyof typeof OCI_ERRORS;
|
|
24
24
|
/**
|
|
25
25
|
* An error of the OCI images, or of the options of the plugin over them: a stable `code`, of
|
|
26
|
-
* {@link OCI_ERRORS} or of `
|
|
26
|
+
* {@link OCI_ERRORS} or of `RELEASE_ERRORS` of `@wtf/release/errors`, its `message` what is
|
|
27
27
|
* wrong, and its `details` how to fix it.
|
|
28
28
|
*/
|
|
29
29
|
export declare class OciError extends ReleaseError {
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,0EAA0E;AAC1E,eAAO,MAAM,UAAU;;;;;;;;;CAgBb,CAAA;AAEV,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,CAAA;AAElD;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,YAAY;CAAG"}
|