@tahminator/pipeline 1.0.2 → 1.0.4
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/gh/client.d.ts +6 -3
- package/dist/gh/pr/index.d.ts +1 -2
- package/dist/gh/pr/index.js +8 -8
- package/package.json +1 -1
package/dist/gh/client.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { GitHubOutputManager } from "./output";
|
|
2
|
+
import { GitHubPRManager } from "./pr";
|
|
3
|
+
import { GitHubTagManager } from "./tag";
|
|
1
4
|
export declare class GitHubClient {
|
|
2
5
|
private readonly client;
|
|
3
6
|
private readonly isExplicitToken;
|
|
@@ -5,7 +8,7 @@ export declare class GitHubClient {
|
|
|
5
8
|
private readonly outputManager;
|
|
6
9
|
private readonly prManager;
|
|
7
10
|
constructor(ghToken?: string);
|
|
8
|
-
createTag(...args: Parameters<
|
|
9
|
-
outputToGithubOutput(...args: Parameters<
|
|
10
|
-
updateK8sTagWithPR(...args: Parameters<
|
|
11
|
+
createTag(...args: Parameters<GitHubTagManager["createTag"]>): Promise<void>;
|
|
12
|
+
outputToGithubOutput(...args: Parameters<GitHubOutputManager["outputToGithubOutput"]>): Promise<void>;
|
|
13
|
+
updateK8sTagWithPR(...args: Parameters<GitHubPRManager["updateK8sTagWithPR"]>): Promise<void>;
|
|
11
14
|
}
|
package/dist/gh/pr/index.d.ts
CHANGED
|
@@ -26,8 +26,7 @@ export declare class GitHubPRManager {
|
|
|
26
26
|
* newTag: a70ee0e
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
updateK8sTagWithPR({
|
|
30
|
-
client: Octokit;
|
|
29
|
+
updateK8sTagWithPR({ newTag, imageName, kustomizationFilePath, environment, originRepo, manifestRepo, }: {
|
|
31
30
|
newTag: string;
|
|
32
31
|
imageName: string;
|
|
33
32
|
kustomizationFilePath: string;
|
package/dist/gh/pr/index.js
CHANGED
|
@@ -29,27 +29,27 @@ export class GitHubPRManager {
|
|
|
29
29
|
* newTag: a70ee0e
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
async updateK8sTagWithPR({
|
|
32
|
+
async updateK8sTagWithPR({ newTag, imageName, kustomizationFilePath, environment, originRepo, manifestRepo, }) {
|
|
33
33
|
const [manifestOwner, manifestRepository] = manifestRepo;
|
|
34
34
|
const [originOwner, originRepository] = originRepo;
|
|
35
35
|
const newBranchName = `${imageName}-${newTag}-${Utils.generateShortId()}`;
|
|
36
|
-
const { data: repo } = await client.rest.repos.get({
|
|
36
|
+
const { data: repo } = await this.client.rest.repos.get({
|
|
37
37
|
owner: manifestOwner,
|
|
38
38
|
repo: manifestRepository,
|
|
39
39
|
});
|
|
40
40
|
const baseBranch = repo.default_branch;
|
|
41
|
-
const { data: ref } = await client.rest.git.getRef({
|
|
41
|
+
const { data: ref } = await this.client.rest.git.getRef({
|
|
42
42
|
owner: manifestOwner,
|
|
43
43
|
repo: manifestRepository,
|
|
44
44
|
ref: `heads/${baseBranch}`,
|
|
45
45
|
});
|
|
46
|
-
await client.rest.git.createRef({
|
|
46
|
+
await this.client.rest.git.createRef({
|
|
47
47
|
owner: manifestOwner,
|
|
48
48
|
repo: manifestRepository,
|
|
49
49
|
ref: `refs/heads/${newBranchName}`,
|
|
50
50
|
sha: ref.object.sha,
|
|
51
51
|
});
|
|
52
|
-
const { data: file } = await client.rest.repos.getContent({
|
|
52
|
+
const { data: file } = await this.client.rest.repos.getContent({
|
|
53
53
|
owner: manifestOwner,
|
|
54
54
|
repo: manifestRepository,
|
|
55
55
|
path: kustomizationFilePath,
|
|
@@ -74,7 +74,7 @@ export class GitHubPRManager {
|
|
|
74
74
|
targetImage.newTag = newTag;
|
|
75
75
|
doc.set("images", yamlObj.images);
|
|
76
76
|
const updatedYaml = doc.toString();
|
|
77
|
-
await client.rest.repos.createOrUpdateFileContents({
|
|
77
|
+
await this.client.rest.repos.createOrUpdateFileContents({
|
|
78
78
|
owner: manifestOwner,
|
|
79
79
|
repo: manifestRepository,
|
|
80
80
|
path: kustomizationFilePath,
|
|
@@ -83,7 +83,7 @@ export class GitHubPRManager {
|
|
|
83
83
|
sha: file.sha,
|
|
84
84
|
branch: newBranchName,
|
|
85
85
|
});
|
|
86
|
-
const { data: pr } = await client.rest.pulls.create({
|
|
86
|
+
const { data: pr } = await this.client.rest.pulls.create({
|
|
87
87
|
owner: manifestOwner,
|
|
88
88
|
repo: manifestRepository,
|
|
89
89
|
title: `Deploying ${newTag} for ${imageName} in ${environment}`,
|
|
@@ -91,7 +91,7 @@ export class GitHubPRManager {
|
|
|
91
91
|
base: baseBranch,
|
|
92
92
|
body: `Automated image tag change to ${newTag} for ${imageName} in ${environment} triggered by [${originOwner}/${originRepository}](https://github.com/${originOwner}/${originRepository}).`,
|
|
93
93
|
});
|
|
94
|
-
await client.rest.pulls.merge({
|
|
94
|
+
await this.client.rest.pulls.merge({
|
|
95
95
|
owner: manifestOwner,
|
|
96
96
|
repo: manifestRepository,
|
|
97
97
|
pull_number: pr.number,
|