forked from awslabs/cdk-serverless-clamscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.js
151 lines (149 loc) · 4.95 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
const { awscdk } = require('projen');
const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN';
const MAJOR = 1;
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Amazon Web Services',
authorAddress: 'donti@amazon.com',
cdkVersion: '1.101.0',
defaultReleaseBranch: 'main',
majorVersion: MAJOR,
releaseBranches: { 'v2-main': { majorVersion: 2 } },
jsiiFqn: 'projen.AwsCdkConstructLibrary',
name: 'cdk-serverless-clamscan',
repositoryUrl: 'https://github.com/awslabs/cdk-serverless-clamscan',
description: 'Serverless architecture to virus scan objects in Amazon S3.',
cdkDependencies: [
'@aws-cdk/aws-cloudtrail',
'@aws-cdk/aws-ec2',
'@aws-cdk/aws-efs',
'@aws-cdk/aws-events',
'@aws-cdk/aws-events-targets',
'@aws-cdk/aws-iam',
'@aws-cdk/aws-lambda',
'@aws-cdk/aws-lambda-destinations',
'@aws-cdk/aws-lambda-event-sources',
'@aws-cdk/aws-s3',
'@aws-cdk/aws-sqs',
'@aws-cdk/core',
],
devDeps: ['cdk-nag@^1', '@aws-cdk/assert@^1'],
bin: ['./assets'],
keywords: [
'clamav',
'virus scan',
'aws',
'docker',
'serverless',
'lambda',
's3',
'efs',
'eventbridge',
'sqs',
],
license: 'Apache-2.0',
gitignore: [
'.vscode/',
'.venv/',
'cdk.out',
'cdk.context.json',
'dockerAssets.d',
'package-lock.json',
'yarn-error.log',
],
pullRequestTemplateContents: [
'',
'----',
'',
'*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*',
],
publishToPypi: {
distName: 'cdk-serverless-clamscan',
module: 'cdk_serverless_clamscan',
},
projenUpgradeSecret: AUTOMATION_TOKEN,
autoApproveOptions: {
secret: 'GITHUB_TOKEN',
allowedUsernames: ['dontirun'],
},
autoApproveUpgrades: true,
depsUpgradeOptions: {
ignoreProjen: false,
workflowOptions: {
labels: ['auto-approve'],
secret: AUTOMATION_TOKEN,
container: {
image: 'jsii/superchain:1-buster-slim-node14',
},
},
},
githubOptions: {
mergify: false,
},
buildWorkflow: true,
release: true,
postBuildSteps: [
{
name: 'remove changelog',
run: 'rm dist/changelog.md',
},
{
name: 'Setup for monocdk build',
run: "rm yarn.lock\nrm .projenrc.js\nmv .projenrc.monocdk.js .projenrc.js\nfind ./src -type f | xargs sed -i 's,@aws-cdk/core,monocdk,g'\nfind ./test -type f | xargs sed -i 's,@aws-cdk/core,monocdk,g'\nfind ./src -type f | xargs sed -i 's,@aws-cdk,monocdk,g'\nfind ./test -type f | xargs sed -i 's,@aws-cdk,monocdk,g'\nfind ./test -type f | xargs sed -i 's,monocdk/assert,@monocdk-experiment/assert,g'\nfind ./test -type f | xargs sed -i 's,cdk-nag,monocdk-nag,g'",
},
{
name: 'Bump to next version',
run: 'npx projen bump',
},
{
name: 'Build for monocdk',
run: 'npx projen build',
},
{
name: 'Unbump',
run: 'npx projen unbump',
},
],
projenVersion: '0.45.4',
});
project.package.addField('resolutions', {
'set-value': '^4.0.1',
'ansi-regex': '^5.0.1',
'json-schema': '^0.4.0',
});
const monocdkTask = project.addTask('release:monocdk', {
env: {
RELEASE: 'true',
MAJOR: MAJOR,
},
});
monocdkTask.exec('git reset --hard', { name: 'reset changes' });
monocdkTask.exec('[ -e dist/changelog.md ] && rm dist/changelog.md', {
name: 'remove changelog',
});
monocdkTask.exec(
"rm yarn.lock\nrm .projenrc.js\nmv .projenrc.monocdk.js .projenrc.js\nfind ./src -type f | xargs sed -i 's,@aws-cdk/core,monocdk,g'\nfind ./test -type f | xargs sed -i 's,@aws-cdk/core,monocdk,g'\nfind ./src -type f | xargs sed -i 's,@aws-cdk,monocdk,g'\nfind ./test -type f | xargs sed -i 's,@aws-cdk,monocdk,g'\nfind ./test -type f | xargs sed -i 's,monocdk/assert,@monocdk-experiment/assert,g'\nfind ./test -type f | xargs sed -i 's,cdk-nag,monocdk-nag,g'",
{ name: 'Setup for monocdk build' },
);
monocdkTask.spawn('bump');
monocdkTask.spawn('build');
monocdkTask.spawn('unbump');
monocdkTask.exec('git reset --hard', { name: 'reset changes' });
const releaseWorkflow = project.tryFindObjectFile(
'.github/workflows/release.yml',
);
releaseWorkflow.addOverride('jobs.release.env.RELEASE', 'true');
releaseWorkflow.addOverride('jobs.release.env.MAJOR', 1);
project.buildWorkflow.file.addOverride(
'jobs.build.steps',
project.buildWorkflow.jobs.build.steps.concat([
{
name: 'Setup for monocdk build',
run: "rm yarn.lock\nrm .projenrc.js\nmv .projenrc.monocdk.js .projenrc.js\nfind ./src -type f | xargs sed -i 's,@aws-cdk/core,monocdk,g'\nfind ./test -type f | xargs sed -i 's,@aws-cdk/core,monocdk,g'\nfind ./src -type f | xargs sed -i 's,@aws-cdk,monocdk,g'\nfind ./test -type f | xargs sed -i 's,@aws-cdk,monocdk,g'\nfind ./test -type f | xargs sed -i 's,monocdk/assert,@monocdk-experiment/assert,g'\nfind ./test -type f | xargs sed -i 's,cdk-nag,monocdk-nag,g'",
},
{
name: 'Build for monocdk',
run: 'npx projen build',
},
]),
);
project.synth();