Skip to content

Commit bf1255f

Browse files
authored
fix(ci): apply Kondukto changes to evergreen template file (#2388)
aba4ba1 included the correct changes but in the wrong file (evergreen.yml instead of the template file), so 89762a5 undid those changes partially and our CI has been failing since then. Applying these changes to the correct file should fix that.
1 parent 6bcb6f2 commit bf1255f

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.evergreen.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,6 +3780,23 @@ functions:
37803780
# - signature_tag (either 'signed' or 'unsigned')
37813781
###
37823782
add_crypt_shared_and_sbom:
3783+
- command: ec2.assume_role
3784+
display_name: Assume IAM role with permissions to pull Kondukto API token
3785+
params:
3786+
role_arn: ${kondukto_role_arn}
3787+
- command: shell.exec
3788+
display_name: Pull Kondukto API token from AWS Secrets Manager and write it to file
3789+
params:
3790+
silent: true
3791+
shell: bash
3792+
working_dir: src
3793+
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
3794+
script: |
3795+
set -e
3796+
# use AWS CLI to get the Kondukto API token from AWS Secrets Manager
3797+
kondukto_token=$(aws secretsmanager get-secret-value --secret-id "kondukto-token" --region "us-east-1" --query 'SecretString' --output text)
3798+
# set the KONDUKTO_TOKEN environment variable
3799+
echo "KONDUKTO_TOKEN=$kondukto_token" > /tmp/kondukto_credentials.env
37833800
- command: subprocess.exec
37843801
params:
37853802
working_dir: src
@@ -3790,10 +3807,8 @@ functions:
37903807
PACKAGE_VARIANT: ${package_variant}
37913808
ARTIFACTORY_USERNAME: ${artifactory_username}
37923809
ARTIFACTORY_PASSWORD: ${artifactory_password}
3793-
# for Silk SBOM integration
3794-
SILK_ASSET_GROUP: mongosh-${executable_os_id}
3795-
SILK_CLIENT_ID: ${silk_client_id}
3796-
SILK_CLIENT_SECRET: ${silk_client_secret}
3810+
# for Kondukto SBOM integration
3811+
KONDUKTO_BRANCH: ${branch_name}_${executable_os_id}
37973812
create_static_analysis_report:
37983813
- command: s3.get
37993814
params:

.evergreen/evergreen.yml.in

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,23 @@ functions:
489489
# - signature_tag (either 'signed' or 'unsigned')
490490
###
491491
add_crypt_shared_and_sbom:
492+
- command: ec2.assume_role
493+
display_name: Assume IAM role with permissions to pull Kondukto API token
494+
params:
495+
role_arn: ${kondukto_role_arn}
496+
- command: shell.exec
497+
display_name: Pull Kondukto API token from AWS Secrets Manager and write it to file
498+
params:
499+
silent: true
500+
shell: bash
501+
working_dir: src
502+
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
503+
script: |
504+
set -e
505+
# use AWS CLI to get the Kondukto API token from AWS Secrets Manager
506+
kondukto_token=$(aws secretsmanager get-secret-value --secret-id "kondukto-token" --region "us-east-1" --query 'SecretString' --output text)
507+
# set the KONDUKTO_TOKEN environment variable
508+
echo "KONDUKTO_TOKEN=$kondukto_token" > /tmp/kondukto_credentials.env
492509
- command: subprocess.exec
493510
params:
494511
working_dir: src
@@ -499,10 +516,8 @@ functions:
499516
PACKAGE_VARIANT: ${package_variant}
500517
ARTIFACTORY_USERNAME: ${artifactory_username}
501518
ARTIFACTORY_PASSWORD: ${artifactory_password}
502-
# for Silk SBOM integration
503-
SILK_ASSET_GROUP: mongosh-${executable_os_id}
504-
SILK_CLIENT_ID: ${silk_client_id}
505-
SILK_CLIENT_SECRET: ${silk_client_secret}
519+
# for Kondukto SBOM integration
520+
KONDUKTO_BRANCH: ${branch_name}_${executable_os_id}
506521
create_static_analysis_report:
507522
<%
508523
let firstPartyDepsFilenames = [];

0 commit comments

Comments
 (0)