forked from aws-samples/amazon-eks-refarch-cloudformation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.js
71 lines (62 loc) · 1.79 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
const {
AwsCdkTypeScriptApp,
} = require('projen');
const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN';
const project = new AwsCdkTypeScriptApp({
cdkVersion: '1.81.0',
name: 'amazon-eks-refarch',
authorName: 'Pahud Hsieh',
authorEmail: '[email protected]',
repository: 'https://github.com/aws-samples/amazon-eks-refarch-cloudformation.git',
dependabot: false,
defaultReleaseBranch: 'master',
antitamper: false,
cdkDependencies: [
'@aws-cdk/core',
'@aws-cdk/aws-ec2',
'@aws-cdk/aws-eks',
'@aws-cdk/aws-iam',
],
deps: ['awscdk-81-patch'],
});
// 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',
},
},
],
},
});
const common_exclude = ['cdk.out', 'cdk.context.json', 'images', 'yarn-error.log'];
project.npmignore.exclude(...common_exclude);
project.gitignore.exclude(...common_exclude);
project.synth();