-
Notifications
You must be signed in to change notification settings - Fork 11
/
.projenrc.ts
102 lines (95 loc) · 3.74 KB
/
.projenrc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { awscdk, Gitpod, DevEnvironmentDockerImage, ReleasableCommits } from 'projen';
import { NpmAccess } from 'projen/lib/javascript';
import { WorkflowNoDockerPatch } from './projenrc/workflow-no-docker-patch';
// the version of k8s this branch supports
const SPEC_VERSION = '29';
const releaseWorkflowName = `release-kubectl-v${SPEC_VERSION}`;
const defaultReleaseBranchName = `kubectl-v${SPEC_VERSION}/main`;
const project = new awscdk.AwsCdkConstructLibrary({
projenrcTs: true,
author: 'Amazon Web Services',
authorAddress: '[email protected]',
cdkVersion: '2.94.0',
name: `@aws-cdk/lambda-layer-kubectl-v${SPEC_VERSION}`,
description: `A Lambda Layer that contains kubectl v1.${SPEC_VERSION}`,
repositoryUrl: 'https://github.com/cdklabs/awscdk-asset-kubectl.git',
homepage: 'https://github.com/cdklabs/awscdk-asset-kubectl#readme',
autoApproveOptions: {
allowedUsernames: ['aws-cdk-automation', 'mergify[bot]'],
secret: 'GITHUB_TOKEN',
},
autoApproveUpgrades: true,
// We support the last 3 minor versions just like Kubernetes
// We also need to keep supporting v20 since it is a hard dependency of aws-cdk-lib
depsUpgradeOptions: {
workflowOptions: {
branches: [
'kubectl-v20/main', // this must be supported because aws-cdk-lib depends on it
`kubectl-v${SPEC_VERSION}/main`,
`kubectl-v${Number(SPEC_VERSION)-1}/main`,
`kubectl-v${Number(SPEC_VERSION)-2}/main`,
],
labels: ['auto-approve'],
},
},
majorVersion: 2,
npmAccess: NpmAccess.PUBLIC,
releaseTagPrefix: `kubectl-v${SPEC_VERSION}`,
releaseWorkflowName: releaseWorkflowName,
// If we don't do this we release the devDependency updates that happen every day, which blows out
// our PyPI storage budget even though there aren't any functional changes.
releasableCommits: ReleasableCommits.featuresAndFixes(),
defaultReleaseBranch: defaultReleaseBranchName,
publishToPypi: {
distName: `aws-cdk.lambda-layer-kubectl-v${SPEC_VERSION}`,
module: `aws_cdk.lambda_layer_kubectl_v${SPEC_VERSION}`,
},
publishToMaven: {
javaPackage: `software.amazon.awscdk.cdk.lambdalayer.kubectl.v${SPEC_VERSION}`,
mavenGroupId: 'software.amazon.awscdk',
mavenArtifactId: `cdk-lambda-layer-kubectl-v${SPEC_VERSION}`,
mavenEndpoint: 'https://aws.oss.sonatype.org',
},
publishToNuget: {
dotNetNamespace: `Amazon.CDK.LambdaLayer.KubectlV${SPEC_VERSION}`,
packageId: `Amazon.CDK.LambdaLayer.KubectlV${SPEC_VERSION}`,
},
publishToGo: {
moduleName: 'github.com/cdklabs/awscdk-kubectl-go',
packageName: `kubectlv${SPEC_VERSION}`,
gitBranch: `kubectl.${SPEC_VERSION}`,
gitUserName: 'AWS CDK Team',
gitUserEmail: '[email protected]',
githubTokenSecret: 'PROJEN_GITHUB_TOKEN',
},
githubOptions: {
mergifyOptions: {
rules: [{
name: 'backport patches to kubectl-v21+ branches',
conditions: [
'label=backport-to-kubectl-v21+',
`base=kubectl-v${SPEC_VERSION}/main`,
],
actions: {
backport: {
regexes: [`kubectl-v(?!20|${SPEC_VERSION})[\\d]*\\/main`],
labels: ['auto-approve'],
},
},
}],
},
},
});
// Fix Docker on GitHub
new WorkflowNoDockerPatch(project, { workflow: 'build' });
new WorkflowNoDockerPatch(project, { workflow: 'release', workflowName: `release-kubectl-v${SPEC_VERSION}` });
project.preCompileTask.exec('layer/build.sh');
// For gitpod users, use jsii/superchain as the dockerImage for the workspace.
const gitpod = new Gitpod(project, {
dockerImage: DevEnvironmentDockerImage.fromImage('public.ecr.aws/jsii/superchain:1-buster-slim-node18'),
});
gitpod.addVscodeExtensions(
'dbaeumer.vscode-eslint',
'AmazonWebServices.aws-toolkit-vscode',
);
project.synth();