Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbom work 101124 #151

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading