File tree Expand file tree Collapse file tree 2 files changed +23
-14
lines changed Expand file tree Collapse file tree 2 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -3780,6 +3780,23 @@ functions:
3780
3780
# - signature_tag (either 'signed' or 'unsigned')
3781
3781
# ##
3782
3782
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
3783
3800
- command : subprocess.exec
3784
3801
params :
3785
3802
working_dir : src
@@ -3791,9 +3808,7 @@ functions:
3791
3808
ARTIFACTORY_USERNAME : ${artifactory_username}
3792
3809
ARTIFACTORY_PASSWORD : ${artifactory_password}
3793
3810
# 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}
3811
+ KONDUKTO_BRANCH : ${branch_name}_${executable_os_id}
3797
3812
create_static_analysis_report :
3798
3813
- command : s3.get
3799
3814
params :
Original file line number Diff line number Diff line change @@ -11,21 +11,15 @@ cat dist/.purls.txt
11
11
12
12
set +x
13
13
echo " ${ARTIFACTORY_PASSWORD} " | docker login artifactory.corp.mongodb.com --username " ${ARTIFACTORY_USERNAME} " --password-stdin
14
- cat << EOF > silkbomb.env
15
- SILK_CLIENT_ID=${SILK_CLIENT_ID}
16
- SILK_CLIENT_SECRET=${SILK_CLIENT_SECRET}
17
- EOF
18
14
set -x
19
15
20
16
trap_handler () {
21
- rm -f silkbomb .env
17
+ rm -f /tmp/kondukto_credentials .env
22
18
}
23
19
trap trap_handler ERR EXIT
24
20
25
- docker pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1 .0
26
- docker run --rm -v ${PWD} :/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1 .0 update \
21
+ docker pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2 .0
22
+ docker run --rm -v ${PWD} :/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2 .0 update \
27
23
--purls /pwd/dist/.purls.txt --sbom-out /pwd/dist/.sbom-lite.json
28
- docker run --env-file silkbomb.env --rm -v ${PWD} :/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 upload \
29
- --silk-asset-group " ${SILK_ASSET_GROUP} " --sbom-in /pwd/dist/.sbom-lite.json
30
- docker run --env-file silkbomb.env --rm -v ${PWD} :/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 download \
31
- --silk-asset-group " ${SILK_ASSET_GROUP} " --sbom-out /pwd/dist/.sbom.json
24
+ docker run --env-file /tmp/kondukto_credentials.env --rm -v ${PWD} :/pwd artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 augment \
25
+ --repo mongodb-js/mongosh --branch ${KONDUKTO_BRANCH} --sbom-in /pwd/dist/.sbom-lite.json --sbom-out /pwd/dist/.sbom.json
You can’t perform that action at this time.
0 commit comments