-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy path.projenrc.js
116 lines (102 loc) · 2.9 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
const { AwsCdkConstructLibrary } = require('projen');
const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN';
const project = new AwsCdkConstructLibrary({
author: 'Pahud Hsieh',
authorAddress: '[email protected]',
description: 'CDK construct library that allows you to create KeyCloak service on AWS in TypeScript or Python',
cdkVersion: '1.73.0',
jsiiFqn: 'projen.AwsCdkConstructLibrary',
name: 'cdk-keycloak',
repositoryUrl: 'https://github.com/pahud/cdk-keycloak.git',
cdkDependencies: [
'@aws-cdk/aws-autoscaling',
'@aws-cdk/aws-certificatemanager',
'@aws-cdk/aws-ec2',
'@aws-cdk/aws-ecs',
'@aws-cdk/aws-elasticloadbalancingv2',
'@aws-cdk/aws-iam',
'@aws-cdk/aws-logs',
'@aws-cdk/aws-rds',
'@aws-cdk/aws-secretsmanager',
'@aws-cdk/core',
],
dependabot: false,
catalog: {
announce: false,
twitter: 'pahudnet',
},
releaseBranches: ['main'],
defaultReleaseBranch: ['main'],
publishToPypi: {
distName: 'cdk-keycloak',
module: 'cdk_keycloak',
},
keywords: [
'cdk',
'keycloak',
'aws',
],
});
// create a custom projen and yarn upgrade workflow
autoApprove = project.github.addWorkflow('AutoApprove');
autoApprove.on({
pull_request_target: {
types: ['assigned', 'opened', 'synchronize', 'reopened'],
},
});
autoApprove.addJobs({
'auto-approve': {
'runs-on': 'ubuntu-latest',
'steps':
[
{
uses: 'hmarr/[email protected]',
if: "github.actor == 'pahud' || contains( github.event.pull_request.labels.*.name, 'auto-approve')",
with: {
'github-token': '${{ secrets.GITHUB_TOKEN }}',
},
},
],
},
});
// create a custom projen and yarn upgrade workflow
workflow = project.github.addWorkflow('ProjenYarnUpgrade');
workflow.on({
schedule: [{
cron: '11 0 * * *',
}], // 0:11am every day
workflow_dispatch: {}, // allow manual triggering
});
workflow.addJobs({
upgrade: {
'runs-on': 'ubuntu-latest',
'steps': [
{ uses: 'actions/checkout@v2' },
{
uses: 'actions/setup-node@v1',
with: {
'node-version': '10.17.0',
},
},
{ run: 'yarn upgrade' },
{ run: 'yarn projen:upgrade' },
// submit a PR
{
name: 'Create Pull Request',
uses: 'peter-evans/create-pull-request@v3',
with: {
'token': '${{ secrets.' + AUTOMATION_TOKEN + ' }}',
'commit-message': 'chore: upgrade projen',
'branch': 'auto/projen-upgrade',
'title': 'chore: upgrade projen and yarn',
'body': 'This PR upgrades projen and yarn upgrade to the latest version',
'labels': 'auto-merge,auto-approve',
},
},
],
},
});
const common_exclude = ['cdk.out', 'cdk.context.json', 'images', 'yarn-error.log', 'dependabot.yml'];
project.npmignore.exclude(...common_exclude);
project.gitignore.exclude(...common_exclude);
project.synth();