@bifravst/ci 1.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/ContinuousDeployment.d.ts +12 -0
- package/dist/ContinuousDeployment.js +23 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Bifravst CI [](https://www.npmjs.com/package/@bifravst/ci)
|
|
2
2
|
|
|
3
3
|
[](https://github.com/bifravst/ci/actions/workflows/test-and-release.yaml)
|
|
4
4
|
[](https://github.com/semantic-release/semantic-release)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { aws_iam as IAM } from 'aws-cdk-lib';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
export declare class ContinuousDeployment extends Construct {
|
|
4
|
+
readonly role: IAM.IRole;
|
|
5
|
+
constructor(parent: Construct, { repository: { owner, repo }, gitHubOICDProviderArn, }: {
|
|
6
|
+
repository: {
|
|
7
|
+
owner: string;
|
|
8
|
+
repo: string;
|
|
9
|
+
};
|
|
10
|
+
gitHubOICDProviderArn: string;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Duration, aws_iam as IAM, Stack } from 'aws-cdk-lib';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
export class ContinuousDeployment extends Construct {
|
|
4
|
+
role;
|
|
5
|
+
constructor(parent, { repository: { owner, repo }, gitHubOICDProviderArn, }) {
|
|
6
|
+
super(parent, 'cd');
|
|
7
|
+
const gitHubOIDC = IAM.OpenIdConnectProvider.fromOpenIdConnectProviderArn(this, 'gitHubOICDProvider', gitHubOICDProviderArn);
|
|
8
|
+
this.role = new IAM.Role(this, 'ghRole', {
|
|
9
|
+
roleName: `${Stack.of(this).stackName}-cd`,
|
|
10
|
+
assumedBy: new IAM.WebIdentityPrincipal(gitHubOIDC.openIdConnectProviderArn, {
|
|
11
|
+
StringEquals: {
|
|
12
|
+
[`token.actions.githubusercontent.com:sub`]: `repo:${owner}/${repo}:environment:production`,
|
|
13
|
+
[`token.actions.githubusercontent.com:aud`]: 'sts.amazonaws.com',
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
description: `This role is used by GitHub Actions to deploy ${Stack.of(this).stackName}`,
|
|
17
|
+
maxSessionDuration: Duration.hours(1),
|
|
18
|
+
managedPolicies: [
|
|
19
|
+
IAM.ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'),
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifravst/ci",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Sets up the permissions in our CI account for all repositories in this account to be able to use it for CI runs.",
|
|
5
5
|
"exports": {
|
|
6
|
-
"
|
|
6
|
+
".": {
|
|
7
7
|
"import": {
|
|
8
|
-
"types": "./dist
|
|
9
|
-
"default": "./dist
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
},
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"author": "Nordic Semiconductor ASA | nordicsemi.no",
|
|
35
35
|
"license": "BSD-3-Clause",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@bifravst/eslint-config-typescript": "6.0.
|
|
37
|
+
"@bifravst/eslint-config-typescript": "6.0.22",
|
|
38
38
|
"@bifravst/prettier-config": "1.0.0",
|
|
39
39
|
"@commitlint/config-conventional": "19.1.0",
|
|
40
40
|
"@nordicsemiconductor/from-env": "3.0.1",
|
|
41
41
|
"@octokit/rest": "20.1.0",
|
|
42
|
-
"aws-cdk": "2.
|
|
43
|
-
"aws-cdk-lib": "2.
|
|
44
|
-
"cdk": "2.
|
|
42
|
+
"aws-cdk": "2.137.0",
|
|
43
|
+
"aws-cdk-lib": "2.137.0",
|
|
44
|
+
"cdk": "2.137.0",
|
|
45
45
|
"check-node-version": "4.2.1",
|
|
46
46
|
"commitlint": "19.2.1",
|
|
47
47
|
"constructs": "10.3.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
],
|
|
96
96
|
"prettier": "@bifravst/prettier-config",
|
|
97
97
|
"peerDependencies": {
|
|
98
|
-
"@aws-sdk/client-iam": "^3.
|
|
98
|
+
"@aws-sdk/client-iam": "^3.552.0",
|
|
99
99
|
"chalk": "^5.3.0"
|
|
100
100
|
}
|
|
101
101
|
}
|