1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ release_date=${DATE:- $(date -u ' +%Y-%m-%d' )}
5+
6+ export DATE=" ${release_date} "
7+
8+ if [ -z " ${AUTHOR:- } " ]; then
9+ AUTHOR=$( git config user.name)
10+ fi
11+
12+ if [ -z " ${VERSION:- } " ]; then
13+ VERSION=$( git tag --list ' v*' --sort=-taggerdate | head -1 | cut -d ' v' -f 2)
14+ fi
15+
16+ if [ " ${AUGMENTED_REPORT:- false} " = " true" ]; then
17+ target_dir=" ."
18+ file_name=" ssdlc-compliance-${VERSION} -${DATE} .md"
19+ SBOM_TEXT=" - See Augmented SBOM manifests (CycloneDX in JSON format):
20+ - This file has been provided along with this report under the name 'linux_amd64_augmented_sbom_v${VERSION} .json'
21+ - Please note that this file was generated on ${DATE} and may not reflect the latest security information of all third party dependencies."
22+
23+ else # If not augmented, generate the standard report
24+ target_dir=" compliance/v${VERSION} "
25+ file_name=" ssdlc-compliance-${VERSION} .md"
26+ SBOM_TEXT=" - See SBOM Lite manifests (CycloneDX in JSON format):
27+ - https://github.com/mongodb/terraform-provider-mongodbatlas/releases/download/terraform-provider-mongodbatlas%2Fv${VERSION} /sbom.json"
28+ # Ensure terraform-provider-mongodbatlas version directory exists
29+ mkdir -p " ${target_dir} "
30+ fi
31+
32+ export AUTHOR
33+ export VERSION
34+ export SBOM_TEXT
35+
36+ echo " Generating SSDLC report for MongoDB Atlas AWS CDK Resources version ${VERSION} , author ${AUTHOR} and release date ${DATE} ..."
37+
38+ envsubst < templates/ssdlc-compliance.template.md \
39+ > " ${target_dir} /${file_name} "
40+
41+ echo " SSDLC compliance report ready. Files in ${target_dir} /:"
42+ ls -l " ${target_dir} /"
43+
44+ echo " Printing the generated report:"
45+ cat " ${target_dir} /${file_name} "
0 commit comments