Skip to content

Commit

Permalink
sbom work 101124 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerickson authored Oct 18, 2024
1 parent 8f0647d commit 193e4d8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SBOMs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

## overview

TBD
SBOMs created by monopacker are stored in https://github.com/mozilla-platform-ops/monopacker-sboms.

The `./copy-to-monopacker-sboms.sh` script copies SBOMs to the repo checkout and provides directions on commiting.
52 changes: 52 additions & 0 deletions SBOMs/copy-to-monopacker-sboms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

# set -x
set -e

# Get the directory where the script is located
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Set the destination path relative to the script directory
DEST_DIR="$SCRIPTDIR/../../monopacker-sboms/"
DEST_DIR="$(realpath $DEST_DIR)"

# Rsync command with additional excludes
rsync -av \
--exclude=".gitignore" \
--exclude="*.sh" \
--exclude="old/" \
--exclude="*monopacker-testing*" \
--exclude="temp_sbom.md" \
--exclude="SBOM.md" \
--exclude="README.md" \
"$SCRIPTDIR/" "$DEST_DIR"

# Explanation:
# -a: archive mode (preserves symbolic links, file permissions, user & group ownerships, and timestamps)
# -v: verbose output
# --exclude: to exclude specific files or directories

# here doc for ascii art
cat << "EOF"
## ## ## ### ### ### ## ##
## ## # ## # ## # ## # ## ##
### ## # ## ## #### ### ###
## ## # ## # ## # ## ## ##
### ### ### ### ### ### ###
EOF

# provide directions on how to commit the sboms
cat <<EOF
Please run the following to commit the copied SBOMs.
cd $DEST_DIR
git st
# inspect and ensure the changes are correct
git add .
git commit -m "adding new SBOMs"
git push
EOF

0 comments on commit 193e4d8

Please sign in to comment.