cdk8s-cli 2.2.10 → 2.2.12

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 CHANGED
@@ -13,6 +13,5 @@
13
13
  "targetPRLabels": [
14
14
  "auto-approve"
15
15
  ],
16
- "dir": "/tmp/.backport//repositories/cdk8s-team/cdk8s-cli",
17
16
  "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
18
17
  }
package/.projenrc.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Cdk8sTeamTypeScriptProject } from '@cdk8s/projen-common';
2
- import { github, JsonFile, DependencyType } from 'projen';
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",
@@ -97,7 +96,7 @@
97
96
  "node": ">= 14.17.0"
98
97
  },
99
98
  "license": "Apache-2.0",
100
- "version": "2.2.10",
99
+ "version": "2.2.12",
101
100
  "jest": {
102
101
  "testMatch": [
103
102
  "<rootDir>/src/**/__tests__/**/*.ts?(x)",
@@ -140,6 +139,9 @@
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"
@@ -1,4 +1,4 @@
1
1
  language: typescript
2
- app: ts-node main.ts
2
+ app: npx ts-node main.ts
3
3
  imports:
4
4
  - k8s