cdk8s-cli 2.2.11 → 2.2.13
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/.backportrc.json +0 -1
- package/.gitattributes +1 -1
- package/.projenrc.ts +3 -82
- package/package.json +15 -13
package/.backportrc.json
CHANGED
package/.gitattributes
CHANGED
package/.projenrc.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cdk8sTeamTypeScriptProject } from '@cdk8s/projen-common';
|
|
2
|
-
import {
|
|
2
|
+
import { DependencyType } from 'projen';
|
|
3
3
|
import { addIntegTests } from './projenrc/integ';
|
|
4
4
|
|
|
5
5
|
const project = new Cdk8sTeamTypeScriptProject({
|
|
@@ -58,6 +58,8 @@ const project = new Cdk8sTeamTypeScriptProject({
|
|
|
58
58
|
'@types/glob',
|
|
59
59
|
'typescript-json-schema',
|
|
60
60
|
],
|
|
61
|
+
backport: true,
|
|
62
|
+
backportBranches: ['1.x'],
|
|
61
63
|
|
|
62
64
|
});
|
|
63
65
|
|
|
@@ -89,87 +91,6 @@ schemas.exec('ts-node scripts/crd.schema.ts');
|
|
|
89
91
|
|
|
90
92
|
project.compileTask.spawn(schemas);
|
|
91
93
|
|
|
92
|
-
// run backport in clean directories every time.
|
|
93
|
-
const backportHome = '/tmp/.backport/';
|
|
94
|
-
const backportDir = `${backportHome}/repositories/cdk8s-team/cdk8s-cli`;
|
|
95
|
-
const backportConfig = new JsonFile(project, '.backportrc.json', {
|
|
96
|
-
// see https://github.com/sqren/backport/blob/main/docs/config-file-options.md
|
|
97
|
-
obj: {
|
|
98
|
-
repoOwner: 'cdk8s-team',
|
|
99
|
-
repoName: 'cdk8s-cli',
|
|
100
|
-
signoff: true,
|
|
101
|
-
branchLabelMapping: {
|
|
102
|
-
'^backport-to-(.+)$': '$1',
|
|
103
|
-
},
|
|
104
|
-
prTitle: '{commitMessages}',
|
|
105
|
-
fork: false,
|
|
106
|
-
publishStatusCommentOnFailure: true,
|
|
107
|
-
publishStatusCommentOnSuccess: true,
|
|
108
|
-
publishStatusCommentOnAbort: true,
|
|
109
|
-
targetPRLabels: [project.autoApprove!.label],
|
|
110
|
-
dir: backportDir,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// backport task to branches based on pr labels
|
|
115
|
-
const backportTask = createBackportTask();
|
|
116
|
-
|
|
117
|
-
// backport tasks to the explicit release branches
|
|
118
|
-
for (const branch of project.release!.branches) {
|
|
119
|
-
createBackportTask(branch);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const backportWorkflow = project.github!.addWorkflow('backport');
|
|
123
|
-
backportWorkflow.on({ pullRequestTarget: { types: ['closed'] } });
|
|
124
|
-
backportWorkflow.addJob('backport', {
|
|
125
|
-
runsOn: ['ubuntu-18.04'],
|
|
126
|
-
permissions: {
|
|
127
|
-
contents: github.workflows.JobPermission.WRITE,
|
|
128
|
-
},
|
|
129
|
-
steps: [
|
|
130
|
-
// needed in order to run the projen task as well
|
|
131
|
-
// as use the backport configuration in the repo.
|
|
132
|
-
{
|
|
133
|
-
name: 'checkout',
|
|
134
|
-
uses: 'actions/checkout@v3',
|
|
135
|
-
with: {
|
|
136
|
-
// required because we need the full history
|
|
137
|
-
// for proper backports.
|
|
138
|
-
'fetch-depth': 0,
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: 'Set Git Identity',
|
|
143
|
-
run: 'git config --global user.name "github-actions" && git config --global user.email "github-actions@github.com"',
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: 'backport',
|
|
147
|
-
if: 'github.event.pull_request.merged == true',
|
|
148
|
-
run: `npx projen ${backportTask.name}`,
|
|
149
|
-
env: {
|
|
150
|
-
GITHUB_TOKEN: '${{ secrets.PROJEN_GITHUB_TOKEN }}',
|
|
151
|
-
BACKPORT_PR_NUMBER: '${{ github.event.pull_request.number }}',
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
function createBackportTask(branch?: string) {
|
|
158
|
-
const name = branch ? `backport:${branch}` : 'backport';
|
|
159
|
-
const task = project.addTask(name, { requiredEnv: ['BACKPORT_PR_NUMBER', 'GITHUB_TOKEN'] });
|
|
160
|
-
task.exec(`rm -rf ${backportHome}`);
|
|
161
|
-
task.exec(`mkdir -p ${backportHome}`);
|
|
162
|
-
task.exec(`cp ${backportConfig.path} ${backportHome}`);
|
|
163
|
-
|
|
164
|
-
const command = ['npx', 'backport', '--accesstoken', '${GITHUB_TOKEN}', '--pr', '${BACKPORT_PR_NUMBER}'];
|
|
165
|
-
if (branch) {
|
|
166
|
-
command.push(...['--branch', branch]);
|
|
167
|
-
} else {
|
|
168
|
-
command.push('--non-interactive');
|
|
169
|
-
}
|
|
170
|
-
task.exec(command.join(' '), { cwd: backportHome });
|
|
171
|
-
return task;
|
|
172
|
-
}
|
|
173
94
|
|
|
174
95
|
addIntegTests(project);
|
|
175
96
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"backport": "npx projen backport",
|
|
13
13
|
"backport:1.x": "npx projen backport:1.x",
|
|
14
|
-
"backport:2.x": "npx projen backport:2.x",
|
|
15
14
|
"build": "npx projen build",
|
|
16
15
|
"bump": "npx projen bump",
|
|
17
16
|
"clobber": "npx projen clobber",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"organization": false
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
|
-
"@cdk8s/projen-common": "^0.0.
|
|
45
|
+
"@cdk8s/projen-common": "^0.0.312",
|
|
47
46
|
"@types/fs-extra": "^8",
|
|
48
47
|
"@types/glob": "^7.2.0",
|
|
49
48
|
"@types/jest": "^27",
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
"jest": "^27",
|
|
60
59
|
"jest-junit": "^15",
|
|
61
60
|
"npm-check-updates": "^16",
|
|
62
|
-
"projen": "^0.
|
|
61
|
+
"projen": "^0.71.15",
|
|
63
62
|
"standard-version": "^9",
|
|
64
63
|
"ts-jest": "^27",
|
|
65
64
|
"ts-node": "^10.9.1",
|
|
@@ -69,16 +68,16 @@
|
|
|
69
68
|
"dependencies": {
|
|
70
69
|
"@types/node": "^14",
|
|
71
70
|
"ajv": "^8.12.0",
|
|
72
|
-
"cdk8s": "^2.7.
|
|
73
|
-
"cdk8s-plus-25": "^2.
|
|
74
|
-
"codemaker": "^1.
|
|
71
|
+
"cdk8s": "^2.7.55",
|
|
72
|
+
"cdk8s-plus-25": "^2.7.0",
|
|
73
|
+
"codemaker": "^1.80.0",
|
|
75
74
|
"colors": "1.4.0",
|
|
76
|
-
"constructs": "^10.1.
|
|
75
|
+
"constructs": "^10.1.314",
|
|
77
76
|
"fs-extra": "^8",
|
|
78
|
-
"jsii-pacmak": "^1.
|
|
79
|
-
"jsii-srcmak": "^0.1.
|
|
80
|
-
"json2jsii": "^0.3.
|
|
81
|
-
"semver": "^7.
|
|
77
|
+
"jsii-pacmak": "^1.80.0",
|
|
78
|
+
"jsii-srcmak": "^0.1.885",
|
|
79
|
+
"json2jsii": "^0.3.325",
|
|
80
|
+
"semver": "^7.5.0",
|
|
82
81
|
"sscaff": "^1.2.274",
|
|
83
82
|
"table": "^6.8.1",
|
|
84
83
|
"yaml": "2.2.1",
|
|
@@ -97,7 +96,7 @@
|
|
|
97
96
|
"node": ">= 14.17.0"
|
|
98
97
|
},
|
|
99
98
|
"license": "Apache-2.0",
|
|
100
|
-
"version": "2.2.
|
|
99
|
+
"version": "2.2.13",
|
|
101
100
|
"jest": {
|
|
102
101
|
"testMatch": [
|
|
103
102
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|
|
@@ -140,9 +139,12 @@
|
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
141
|
},
|
|
142
|
+
"optionalDependencies": {
|
|
143
|
+
"backport": "8.5.0"
|
|
144
|
+
},
|
|
143
145
|
"exports": {
|
|
144
146
|
"./plugins": "./lib/plugins/index.js",
|
|
145
147
|
"./package.json": "./package.json"
|
|
146
148
|
},
|
|
147
|
-
"//": "~~ Generated by projen. To modify, edit .projenrc.
|
|
149
|
+
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
|
|
148
150
|
}
|