Skip to content

Commit

Permalink
fix: update projen
Browse files Browse the repository at this point in the history
  • Loading branch information
Court Schuett committed Sep 7, 2023
1 parent da9c172 commit eaf39bd
Show file tree
Hide file tree
Showing 27 changed files with 3,590 additions and 4,204 deletions.
11 changes: 7 additions & 4 deletions .eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/pull-request-lint.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions .github/workflows/upgrade-site.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/upgrade.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .mergify.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 0 additions & 55 deletions .projenrc.js

This file was deleted.

107 changes: 107 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
const { awscdk } = require('projen');
const { JobPermission } = require('projen/lib/github/workflows-model');
const { UpgradeDependenciesSchedule } = require('projen/lib/javascript');

const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN';
const project = new awscdk.AwsCdkTypeScriptApp({
cdkVersion: '2.68.0',
defaultReleaseBranch: 'main',
name: 'amazon-chime-sdk-meeting-with-live-connector',
appEntrypoint: 'amazon-chime-sdk-meeting-with-live-connector.ts',
workflowNodeVersion: '16.x',
devDeps: ['esbuild'],
deps: [
'fs-extra',
'@types/fs-extra',
'@aws-sdk/client-chime-sdk-media-pipelines',
'@aws-sdk/client-chime-sdk-meetings',
'@aws-sdk/client-dynamodb',
'@aws-sdk/client-ivs',
'@aws-sdk/lib-dynamodb',
'aws-lambda',
'@types/aws-lambda',
],
projenrcTs: true,
autoApproveOptions: {
secret: 'GITHUB_TOKEN',
allowedUsernames: ['schuettc'],
},
depsUpgradeOptions: {
ignoreProjen: false,
workflowOptions: {
labels: ['auto-approve', 'auto-merge'],
schedule: UpgradeDependenciesSchedule.WEEKLY,
},
},
scripts: {
launch:
'yarn && yarn projen && yarn build && yarn cdk bootstrap && yarn cdk deploy && yarn configLocal',
},
});

const upgradeSite = project.github.addWorkflow('upgrade-site');
upgradeSite.on({ schedule: [{ cron: '0 5 * * 1' }], workflowDispatch: {} });
upgradeSite.addJobs({
upgradeSite: {
runsOn: ['ubuntu-latest'],
name: 'upgrade-site',
permissions: {
actions: JobPermission.WRITE,
contents: JobPermission.READ,
idToken: JobPermission.WRITE,
},
steps: [
{ uses: 'actions/checkout@v3' },
{
name: 'Setup Node.js',
uses: 'actions/setup-node@v3',
with: {
'node-version': '18',
},
},
{
run: 'yarn install --check-files --frozen-lockfile',
workingDirectory: 'site',
},
{
run: 'yarn upgrade',
workingDirectory: 'site',
},
{
name: 'Create Pull Request',
uses: 'peter-evans/create-pull-request@v4',
with: {
'token': '${{ secrets.' + AUTOMATION_TOKEN + ' }}',
'commit-message': 'chore: upgrade site',
'branch': 'auto/projen-upgrade',
'title': 'chore: upgrade site',
'body': 'This PR upgrades site',
'labels': 'auto-merge, auto-approve',
'author': 'github-actions <[email protected]>',
'committer': 'github-actions <[email protected]>',
'signoff': true,
},
},
],
},
});

const common_exclude = [
'cdk.out',
'cdk.context.json',
'yarn-error.log',
'dependabot.yml',
'*.drawio',
'.DS_Store',
];

project.addTask('getBucket', {
exec: "aws cloudformation describe-stacks --stack-name AmazonChimeSDKWithLiveConnector --query 'Stacks[0].Outputs[?OutputKey==`siteBucket`].OutputValue' --output text",
});

project.addTask('configLocal', {
exec: 'aws s3 cp s3://$(yarn run --silent getBucket)/config.json site/public/',
});

project.gitignore.exclude(...common_exclude);
project.synth();
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ Once the media live connector has been configured to use the IVS channel, we can

### Service-Linked Role

Included in this demo is a service-linked role that allows the pipelines to access Amazon Chime SDK meetings.
A [service linked role](https://docs.aws.amazon.com/chime-sdk/latest/ag/using-service-linked-roles-media-pipeline.html#create-slr) is required for this deployment.

```typescript
new CfnServiceLinkedRole(this, 'mediaPipelinesSLR', {
awsServiceName: 'mediapipelines.chime.amazonaws.com',
});
If this does not already exist in your account, you can run:

```bash
aws iam create-service-linked-role --aws-service-name mediapipelines.chime.amazonaws.com
```

## Components Deployed
Expand Down
Loading

0 comments on commit eaf39bd

Please sign in to comment.