forked from CloudSnorkel/cdk-turbo-layers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.js
126 lines (121 loc) · 3.88 KB
/
.projenrc.js
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
const { awscdk } = require('projen');
const { Stability } = require('projen/lib/cdk/jsii-project');
const { NodePackageManager } = require('projen/lib/javascript');
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Amir Szekely',
authorAddress: '[email protected]',
stability: Stability.EXPERIMENTAL,
cdkVersion: '2.77.0', // 2.54.0 for https://github.com/aws/aws-cdk/pull/22124, 2.77.0 for removing node 14
defaultReleaseBranch: 'main',
name: '@cloudsnorkel/cdk-turbo-layers',
repositoryUrl: 'https://github.com/CloudSnorkel/cdk-turbo-layers.git',
license: 'Apache-2.0',
description: 'Speed-up Lambda function deployment with dependency layers built in AWS',
devDeps: [
'esbuild', // for faster NodejsFunction bundling
'aws-sdk',
'@aws-sdk/types',
'@types/aws-lambda',
'adm-zip',
'@types/adm-zip',
'xterm-benchmark',
'execa',
'@aws-cdk/aws-lambda-python-alpha',
],
deps: [
],
releaseToNpm: true,
publishToPypi: {
distName: 'cloudsnorkel.cdk-turbo-layers',
module: 'cloudsnorkel.cdk_turbo_layers',
},
publishToGo: {
moduleName: 'github.com/CloudSnorkel/cdk-turbo-layers-go',
},
publishToMaven: {
mavenGroupId: 'com.cloudsnorkel',
mavenArtifactId: 'cdk.turbo-layers',
javaPackage: 'com.cloudsnorkel.cdk.turbo_layers',
mavenEndpoint: 'https://s01.oss.sonatype.org',
},
publishToNuget: {
dotNetNamespace: 'CloudSnorkel',
packageId: 'CloudSnorkel.Cdk.TurboLayers',
},
keywords: [
'aws',
'aws-cdk',
'aws-cdk-construct',
'cdk',
'codebuild',
'lambda',
'layer',
'python',
'nodejs',
'ruby',
],
gitignore: [
'cdk.out',
'cdk.context.json',
'/.idea',
'status.json',
],
sampleCode: false,
compat: true,
autoApproveOptions: {
allowedUsernames: ['kichik', 'CloudSnorkelBot'],
},
depsUpgradeOptions: {
workflowOptions: {
labels: ['auto-approve'],
schedule: {
cron: ['0 0 * * 1'],
},
},
},
githubOptions: {
pullRequestLintOptions: {
semanticTitleOptions: {
types: [
'feat',
'fix',
'chore',
],
},
},
},
pullRequestTemplate: false,
workflowBootstrapSteps: [
{
name: 'Setup Ruby',
run: 'sudo apt-get update ; sudo apt-get install -y ruby',
},
],
scripts: {
benchmark: 'esbuild benchmark/deployment.ts --bundle --target=node14 --platform=node --outfile=benchmark/deployment.js --format=cjs --external:xterm-benchmark && xterm-benchmark benchmark/deployment.js',
},
eslintOptions: {
dirs: ['benchmark'],
},
tsconfig: {
include: ['benchmark/**/*.ts'],
},
});
// disable automatic releases, but keep workflow that can be triggered manually
const releaseWorkflow = project.github.tryFindWorkflow('release');
releaseWorkflow.file.addDeletionOverride('on.push');
// set proper line endings
project.gitattributes.addAttributes('*.js', 'eol=lf');
project.gitattributes.addAttributes('*.json', 'eol=lf');
project.gitattributes.addAttributes('*.sh', 'eol=lf');
project.gitattributes.addAttributes('*.yml', 'eol=lf');
project.gitattributes.addAttributes('Dockerfile', 'eol=lf');
// extra lambdas
project.bundler.bundleTask.exec('rm -rf assets/package-ruby.lambda');
project.bundler.bundleTask.exec('mkdir -p assets/package-python.lambda assets/package-ruby.lambda');
project.bundler.bundleTask.exec('cp src/package-python.lambda.py assets/package-python.lambda/index.py');
project.bundler.bundleTask.exec('cp src/package-ruby.lambda.rb assets/package-ruby.lambda/index.rb');
project.bundler.bundleTask.exec('gem install --no-document --version 2.3.2 --install-dir assets/package-ruby.lambda/vendor rubyzip');
project.bundler.bundleTask.exec('mv assets/package-ruby.lambda/vendor/gems/rubyzip-2.3.2/lib assets/package-ruby.lambda/rubyzip');
project.bundler.bundleTask.exec('rm -rf assets/package-ruby.lambda/vendor');
project.synth();