forked from CycloneDX/specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: depedabot for all used ecosystems (CycloneDX#424)
- add dependabot for all used ecosystems - revisit doc gen scripts to make dependencies/maintenance more easily --------- Signed-off-by: Jan Kowalleck <[email protected]>
- Loading branch information
1 parent
95c5820
commit 0f00800
Showing
6 changed files
with
114 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,52 @@ | ||
#!/bin/bash | ||
rm -f -R docs | ||
mkdir -p docs/{1.2,1.3,1.4,1.5,1.6} | ||
set -eu | ||
|
||
THIS_PATH="$(realpath "$(dirname "$0")")" | ||
SCHEMA_PATH="$(realpath "$THIS_PATH/../../schema")" | ||
DOCS_PATH="$THIS_PATH/docs" | ||
TEMPLATES_PATH="$THIS_PATH/templates" | ||
|
||
rm -f -R "$DOCS_PATH" | ||
mkdir -p "$DOCS_PATH/"{1.2,1.3,1.4,1.5,1.6} | ||
|
||
# Check to see if generate-schema-doc is executable and is in the path. If not, install JSON Schema for Humans. | ||
if ! [ -x "$(command -v generate-schema-doc)" ]; then | ||
pip3 install json-schema-for-humans==0.47 | ||
if ! [ -x "$(command -v generate-schema-doc)" ] | ||
then | ||
# dependencies managed externally, so dependebot/renovate can pick it up | ||
pip3 install -r "$THIS_PATH/requirements.txt" | ||
fi | ||
|
||
generate () { | ||
version=$1 | ||
title='CycloneDX v'$version' JSON Reference' | ||
echo Generating $title | ||
STRICT_SCHEMA_FILE='../../schema/bom-'$version'-strict.schema.json' | ||
if [ -f "$STRICT_SCHEMA_FILE" ]; then | ||
SCHEMA_FILE='../../schema/bom-'$version'-strict.schema.json' | ||
else | ||
SCHEMA_FILE='../../schema/bom-'$version'.schema.json' | ||
version="$1" | ||
title="CycloneDX v${version} JSON Reference" | ||
echo "Generating: $title" | ||
|
||
SCHEMA_FILE="$SCHEMA_PATH/bom-${version}.schema.json" | ||
STRICT_SCHEMA_FILE="$SCHEMA_PATH/bom-${version}-strict.schema.json" | ||
if [ -f "$STRICT_SCHEMA_FILE" ] | ||
then | ||
SCHEMA_FILE="$STRICT_SCHEMA_FILE" | ||
fi | ||
echo $SCHEMA_FILE | ||
generate-schema-doc --config no_link_to_reused_ref --config no_show_breadcrumbs --config no_collapse_long_descriptions --deprecated-from-description --config title="$title" --config custom_template_path=$(pwd)'/templates/cyclonedx/base.html' --minify $SCHEMA_FILE 'docs/'$version'/index.html' | ||
sed -i -e "s/\${quotedTitle}/\"$title\"/g" 'docs/'$version'/index.html' | ||
sed -i -e "s/\${title}/$title/g" 'docs/'$version'/index.html' | ||
sed -i -e "s/\${version}/$version/g" 'docs/'$version'/index.html' | ||
echo "$SCHEMA_FILE" | ||
|
||
generate-schema-doc \ | ||
--config no_link_to_reused_ref \ | ||
--config no_show_breadcrumbs \ | ||
--config no_collapse_long_descriptions \ | ||
--deprecated-from-description \ | ||
--config title="$title" \ | ||
--config custom_template_path="$TEMPLATES_PATH/cyclonedx/base.html" \ | ||
--minify \ | ||
"$SCHEMA_FILE" \ | ||
"$DOCS_PATH/$version/index.html" | ||
|
||
sed -i -e "s/\${quotedTitle}/\"$title\"/g" "$DOCS_PATH/$version/index.html" | ||
sed -i -e "s/\${title}/$title/g" "$DOCS_PATH/$version/index.html" | ||
sed -i -e "s/\${version}/$version/g" "$DOCS_PATH/$version/index.html" | ||
} | ||
|
||
generate 1.2 | ||
generate 1.3 | ||
generate 1.4 | ||
generate 1.5 | ||
generate 1.6 | ||
generate 1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json-schema-for-humans==0.47 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters