@@ -44,16 +44,10 @@ Resources:
44
44
BuildSpec : codebuild/ci/ci.yml
45
45
GitCloneDepth : 1
46
46
GitSubmodulesConfig :
47
- FetchSubmodules : false
47
+ FetchSubmodules : true
48
48
InsecureSsl : false
49
49
ReportBuildStatus : false
50
50
Type : GITHUB
51
- Triggers :
52
- BuildType : BUILD_BATCH
53
- Webhook : true
54
- FilterGroups :
55
- - - Type : EVENT
56
- Pattern : PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED, PULL_REQUEST_REOPENED
57
51
Artifacts :
58
52
Type : NO_ARTIFACTS
59
53
Cache :
@@ -93,7 +87,9 @@ Resources:
93
87
Source :
94
88
Location : !Ref SourceLocation
95
89
BuildSpec : codebuild/release/release.yml
96
- GitCloneDepth : 1
90
+ # # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-gitclonedepth
91
+ # # If this value is 0, greater than 25, or not provided then the full history is downloaded with each build project.
92
+ GitCloneDepth : 0
97
93
GitSubmodulesConfig :
98
94
FetchSubmodules : false
99
95
InsecureSsl : false
@@ -136,14 +132,15 @@ Resources:
136
132
Path : /service-role/
137
133
RoleName : !Sub "codebuild-${ProjectName}-service-role-ci"
138
134
AssumeRolePolicyDocument : >-
139
- {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"codebuild.amazonaws.com"},"Action":"sts:AssumeRole"}]}
135
+ {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"codebuild.amazonaws.com"},"Action":"sts:AssumeRole"},{"Effect":"Allow","Principal":{"Federated":"arn:aws:iam::587316601012:oidc-provider/token.actions.githubusercontent.com"},"Action":"sts:AssumeRoleWithWebIdentity","Condition":{"StringEquals":{"token.actions.githubusercontent.com:aud":"sts.amazonaws.com"},"StringLike":{"token.actions.githubusercontent.com:sub":"repo:aws/aws-encryption-sdk-java:*"}}} ]}
140
136
MaxSessionDuration : 3600
141
137
ManagedPolicyArns :
142
138
- !Ref CryptoToolsKMS
143
139
- !Ref CodeBuildBatchPolicy
144
140
- !Ref CodeBuildBasePolicy
145
141
- !Ref SecretsManagerPolicyCI
146
142
- !Ref ParameterStorePolicy
143
+ - !Ref CodeBuildBasePolicyCI
147
144
- " arn:aws:iam::aws:policy/AWSCodeArtifactReadOnlyAccess"
148
145
- " arn:aws:iam::aws:policy/AWSCodeArtifactAdminAccess"
149
146
@@ -158,6 +155,7 @@ Resources:
158
155
ManagedPolicyArns :
159
156
- !Ref CryptoToolsKMS
160
157
- !Ref CodeBuildBatchPolicy
158
+ - !Ref CodeBuildBatchPolicyRelease
161
159
- !Ref CodeBuildBasePolicy
162
160
- !Ref SecretsManagerPolicyRelease
163
161
- !Ref ParameterStorePolicy
@@ -184,12 +182,37 @@ Resources:
184
182
"Action": [
185
183
"codebuild:StartBuild",
186
184
"codebuild:StopBuild",
187
- "codebuild:RetryBuild"
185
+ "codebuild:RetryBuild",
186
+ "codebuild:BatchGetBuilds"
188
187
]
189
188
}
190
189
]
191
190
}
192
191
192
+ CodeBuildBatchPolicyRelease :
193
+ Type : " AWS::IAM::ManagedPolicy"
194
+ Properties :
195
+ ManagedPolicyName : !Sub >-
196
+ CodeBuildBuildBatchPolicy-${ProjectName}-Release-${AWS::Region}-codebuild-${ProjectName}-release-service-role
197
+ Path : /service-role/
198
+ PolicyDocument : !Sub |
199
+ {
200
+ "Version": "2012-10-17",
201
+ "Statement": [
202
+ {
203
+ "Effect": "Allow",
204
+ "Resource": [
205
+ "arn:aws:codebuild:us-west-2:${AWS::AccountId}:project/AWS-ESDK-Java-Release"
206
+ ],
207
+ "Action": [
208
+ "codebuild:StartBuild",
209
+ "codebuild:StopBuild",
210
+ "codebuild:RetryBuild"
211
+ ]
212
+ }
213
+ ]
214
+ }
215
+
193
216
CodeBuildBasePolicy :
194
217
Type : " AWS::IAM::ManagedPolicy"
195
218
Properties :
@@ -212,7 +235,8 @@ Resources:
212
235
"Action": [
213
236
"logs:CreateLogGroup",
214
237
"logs:CreateLogStream",
215
- "logs:PutLogEvents"
238
+ "logs:PutLogEvents",
239
+ "logs:GetLogEvents"
216
240
]
217
241
},
218
242
{
@@ -244,6 +268,56 @@ Resources:
244
268
]
245
269
}
246
270
271
+ CodeBuildBasePolicyCI :
272
+ Type : " AWS::IAM::ManagedPolicy"
273
+ Properties :
274
+ ManagedPolicyName : !Sub "CodeBuildBasePolicy-${ProjectName}-CI-${AWS::Region}"
275
+ Path : /service-role/
276
+ PolicyDocument : !Sub |
277
+ {
278
+ "Version": "2012-10-17",
279
+ "Statement": [
280
+ {
281
+ "Effect": "Allow",
282
+ "Resource": [
283
+ "arn:aws:logs:us-west-2:${AWS::AccountId}:log-group:/aws/codebuild/AWS-ESDK-Java-CI",
284
+ "arn:aws:logs:us-west-2:${AWS::AccountId}:log-group:/aws/codebuild/AWS-ESDK-Java-CI:*"
285
+ ],
286
+ "Action": [
287
+ "logs:CreateLogGroup",
288
+ "logs:CreateLogStream",
289
+ "logs:PutLogEvents"
290
+ ]
291
+ },
292
+ {
293
+ "Effect": "Allow",
294
+ "Resource": [
295
+ "arn:aws:s3:::codepipeline-us-west-2-*"
296
+ ],
297
+ "Action": [
298
+ "s3:PutObject",
299
+ "s3:GetObject",
300
+ "s3:GetObjectVersion",
301
+ "s3:GetBucketAcl",
302
+ "s3:GetBucketLocation"
303
+ ]
304
+ },
305
+ {
306
+ "Effect": "Allow",
307
+ "Action": [
308
+ "codebuild:CreateReportGroup",
309
+ "codebuild:CreateReport",
310
+ "codebuild:UpdateReport",
311
+ "codebuild:BatchPutTestCases",
312
+ "codebuild:BatchPutCodeCoverages"
313
+ ],
314
+ "Resource": [
315
+ "arn:aws:codebuild:us-west-2:${AWS::AccountId}:report-group/AWS-ESDK-Java-CI-*"
316
+ ]
317
+ }
318
+ ]
319
+ }
320
+
247
321
AccountIdParameter :
248
322
Type : " AWS::SSM::Parameter"
249
323
Properties :
@@ -264,7 +338,8 @@ Resources:
264
338
{
265
339
"Effect": "Allow",
266
340
"Resource": [
267
- "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-GC6h0A"
341
+ "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-CI-xjAvTM",
342
+ "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-CI-Credentials-eBrSNB"
268
343
],
269
344
"Action": "secretsmanager:GetSecretValue"
270
345
}
@@ -283,8 +358,10 @@ Resources:
283
358
{
284
359
"Effect": "Allow",
285
360
"Resource": [
286
- "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-GC6h0A",
287
- "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Sonatype-Team-Account-0tWvZm"
361
+ "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-Release-haLIjZ",
362
+ "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-Release-Credentials-WgJanS",
363
+ "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Sonatype-Team-Account-0tWvZm",
364
+ "arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Github/aws-crypto-tools-ci-bot-AGUB3U"
288
365
],
289
366
"Action": "secretsmanager:GetSecretValue"
290
367
}
0 commit comments