-
Notifications
You must be signed in to change notification settings - Fork 9
/
.projenrc.js
90 lines (82 loc) · 2.4 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
const { awscdk, DevEnvironmentDockerImage, Gitpod } = require('projen');
const PROJECT_NAME = 'cdk-remote-stack';
const PROJECT_DESCRIPTION = 'Get outputs and AWS SSM parameters from cross-region AWS CloudFormation stacks';
const AUTOMATION_TOKEN = 'AUTOMATION_GITHUB_TOKEN';
const project = new awscdk.AwsCdkConstructLibrary({
authorName: 'Pahud Hsieh',
authorEmail: '[email protected]',
name: PROJECT_NAME,
description: PROJECT_DESCRIPTION,
repository: 'https://github.com/pahud/cdk-remote-stack.git',
authorUrl: 'https://twitter.com/pahudnet',
keywords: [
'aws',
'remote',
'cross-region',
'cross-stack',
'cross-account',
],
/**
* we default release the main branch(cdkv2) with major version 2.
*/
majorVersion: 2,
defaultReleaseBranch: 'main',
/**
* we also release the cdkv1 branch with major version 1.
*/
// releaseBranches: {
// cdkv1: { npmDistTag: 'cdkv1', majorVersion: 1 },
// },
depsUpgradeOptions: {
ignoreProjen: false,
workflowOptions: {
labels: ['auto-approve', 'auto-merge'],
secret: AUTOMATION_TOKEN,
},
},
autoApproveOptions: {
secret: 'GITHUB_TOKEN',
allowedUsernames: ['pahud', 'cdk-automation'],
},
defaultReleaseBranch: 'main',
catalog: {
twitter: 'pahudnet',
announce: false,
},
cdkVersion: '2.85.0',
python: {
distName: 'cdk-remote-stack',
module: 'cdk_remote_stack',
},
});
const gitpodPrebuild = project.addTask('gitpod:prebuild', {
description: 'Prebuild setup for Gitpod',
});
// install and compile only, do not test or package.
gitpodPrebuild.exec('yarn install --frozen-lockfile --check-files');
gitpodPrebuild.exec('npx projen compile');
let gitpod = new Gitpod(project, {
dockerImage: DevEnvironmentDockerImage.fromImage('public.ecr.aws/pahudnet/gitpod-workspace:latest'),
prebuilds: {
addCheck: true,
addBadge: true,
addLabel: true,
branches: true,
pullRequests: true,
pullRequestsFromForks: true,
},
});
gitpod.addCustomTask({
init: 'yarn gitpod:prebuild',
// always upgrade after init
command: 'npx projen upgrade',
});
gitpod.addVscodeExtensions(
'dbaeumer.vscode-eslint',
'ms-azuretools.vscode-docker',
'AmazonWebServices.aws-toolkit-vscode',
);
const common_exclude = ['cdk.out', 'cdk.context.json', 'yarn-error.log'];
project.npmignore.exclude(...common_exclude);
project.gitignore.exclude(...common_exclude);
project.synth();