Skip to content

Commit 87e90ef

Browse files
committed
feat: devide tools in separate files
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 3ded088 commit 87e90ef

276 files changed

Lines changed: 21055 additions & 6216 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Assemble tools.json
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main' ]
6+
paths:
7+
- "tools/*"
8+
- ".github/workflows/assemble_tools_json.yml"
9+
workflow_dispatch:
10+
11+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
12+
permissions: { }
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
assemble:
20+
name: assemble tools.json
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v5
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: 3.x
29+
- name: assemble tools.json
30+
run: helpers/tools-assemble.py
31+
- name: Upload artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: tools.json
35+
path: tools.json
36+
37+
validate:
38+
needs:
39+
- assemble
40+
name: validate tools.json
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v5
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: 3.x
49+
- name: Install check-jsonschema
50+
run: pip install check-jsonschema
51+
- name: Download artifact
52+
uses: actions/download-artifact@v5
53+
with:
54+
name: tools.json
55+
- name: Validate tools.json
56+
run: check-jsonschema --schemafile schemas/tools.schema.json tools.json
57+
58+
push-back:
59+
needs:
60+
- assemble
61+
- validate
62+
name: push tools.json
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: write # needed for git push
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v5
69+
with:
70+
ref: ${{ github.head_ref }}
71+
- name: Download artifact
72+
uses: actions/download-artifact@v5
73+
with:
74+
name: tools.json
75+
- name: diff
76+
run: git diff tools.json
77+
- name: Configure Git
78+
run: |
79+
git config user.name "github-actions[bot]"
80+
git config user.email "github-actions[bot]@users.noreply.github.com"
81+
- name: Commit tools.json
82+
run: |
83+
git add tools.json
84+
git commit -s -m "Update tools.json [automated commit]" || echo "No changes to commit"
85+
- name: git push back
86+
run: git push
87+
88+
publish:
89+
needs:
90+
- push-back
91+
# need to trigger this workflow manually, for the following reason:
92+
# The "publish" workflow is triggered whenever a `tools.json` is modified - which happens during
93+
# the `push-back` step. and this commit is issued by a bot.
94+
# GitHub workflows may triggered on events only if not issues by a bot - so the workflow would
95+
# not trigger automatically.
96+
uses: .github/workflows/publish_toolcenter.yml

.github/workflows/build_docs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ name: Build Docs
33
on:
44
push:
55
branches: ['master', 'main']
6+
paths:
7+
- "schemas/*"
8+
- ".github/workflows/build_docs.yml"
69
workflow_dispatch:
710

8-
env:
9-
PYTHON_VERSION_DEFAULT: "3.10"
10-
1111
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
1212
permissions: {}
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
docs_json:
1620
runs-on: ubuntu-latest
@@ -24,8 +28,7 @@ jobs:
2428
- name: Setup Python Environment
2529
uses: actions/setup-python@v5
2630
with:
27-
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
28-
architecture: 'x64'
31+
python-version: 3.x
2932

3033
- name: Generate Schema documentation
3134
run: ./gen.sh
@@ -45,6 +48,3 @@ jobs:
4548
steps:
4649
- name: Deploy to GitHub Pages
4750
uses: actions/deploy-pages@v4
48-
49-
- name: Trigger Cloudflare Deploy Hook
50-
run: curl -X POST "${{ secrets.CLOUDFLARE_DEPLOY_HOOK }}"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: publish ToolCenter
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main' ]
6+
paths:
7+
- "tools.json"
8+
- ".github/workflows/publish_toolcenter.yml"
9+
workflow_dispatch:
10+
11+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
12+
permissions: { }
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
trigger_deploy:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Trigger Cloudflare Deploy Hook
23+
run: curl -X POST "${{ secrets.CLOUDFLARE_DEPLOY_HOOK }}"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Validate each tool
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main' ]
6+
paths:
7+
- "tools/*"
8+
- "schemas/tool.schema.json"
9+
- ".github/workflows/validate_tools.yml"
10+
pull_request:
11+
paths:
12+
- "tools/*"
13+
- "schemas/tool.schema.json"
14+
- ".github/workflows/validate_tools.yml"
15+
workflow_dispatch:
16+
17+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
18+
permissions: { }
19+
20+
jobs:
21+
validate:
22+
name: validate each tool
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v5
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: 3.x
32+
33+
- name: Install check-jsonschema
34+
run: pip install check-jsonschema
35+
36+
- name: Validate all tools
37+
run: |
38+
set -exu
39+
for tool in tools/*.json
40+
do
41+
check-jsonschema --schemafile schemas/tool.schema.json "$tool"
42+
done

.github/workflows/validate_tools_json.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,28 @@ name: Validate tools.json
22

33
on:
44
push:
5-
paths: [ "tools.json", "tools.schema.json", ".github/workflows/validate_tools_json.yml" ]
5+
branches: [ 'master', 'main' ]
6+
paths:
7+
- "tools.json"
8+
- "schemas/tools.schema.json"
9+
- ".github/workflows/validate_tools_json.yml"
610
pull_request:
7-
paths: [ "tools.json", "tools.schema.json", ".github/workflows/validate_tools_json.yml" ]
11+
branches: [ 'master', 'main' ]
12+
paths:
13+
- "tools.json"
14+
- "schemas/tools.schema.json"
15+
- ".github/workflows/validate_tools_json.yml"
816
workflow_dispatch:
917

1018
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
11-
permissions: {}
19+
permissions: { }
1220

1321
jobs:
1422
validate:
1523
runs-on: ubuntu-latest
1624
steps:
1725
- name: Checkout repository
18-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
1927

2028
- name: Set up Python
2129
uses: actions/setup-python@v5
@@ -26,4 +34,4 @@ jobs:
2634
run: pip install check-jsonschema
2735

2836
- name: Validate tools.json
29-
run: check-jsonschema --schemafile tools.schema.json tools.json
37+
run: check-jsonschema --schemafile schemas/tools.schema.json tools.json

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
The CycloneDX Tool Center is the largest publicly available collection of SBOM (Software Bill of Materials) and xBOM (e.g., SaaSBOM, CBOM, HBOM) products, projects, and services. It serves as a centralized resource for anyone looking to explore, evaluate, or integrate BOM-related capabilities into their toolchains and workflows. The Tool Center is an integral part of the [CycloneDX website](https://cyclonedx.org).
44

5-
As of March 2025, the CycloneDX Tool Center leverages a JSON Schema in which `tools.json` must validate against. [View the human-readable documentation for the JSON Schema](https://cyclonedx.github.io/tool-center/).
5+
As of March 2025, the CycloneDX Tool Center leverages a JSON Schema in which `tools.json` must validate against. [View the human-readable documentation for the JSON Schema](https://cyclonedx.github.io/tool-center/).
6+
As of September 2025, the `tools.json` is assembled automatically from the individual JSON files in the `tools/` folder. Do not modify `tools.json` directly, instead add/modify individual files in the `tools/`folder.
67

78
## License
89

@@ -16,8 +17,8 @@ Contributions are welcome! If you know of a tool, product, or service related to
1617
- Any provided metadata or descriptions are accurate and up-to-date.
1718
- Licensing and attribution requirements for tools are respected.
1819

19-
Editing the `tools.json` file manually can be complicated. An alternative is to use
20-
[MetaConfigurator](https://metaconfigurator.github.io/meta-configurator/?schema=https://raw.githubusercontent.com/CycloneDX/tool-center/refs/heads/main/tools.schema.json&data=https://raw.githubusercontent.com/CycloneDX/tool-center/refs/heads/main/tools.json&settings=https://raw.githubusercontent.com/CycloneDX/tool-center/refs/heads/main/metaConfiguratorSettings.json) to make changes then download the edited data.
20+
Creating/editing a file in the `tools/` folder manually can be complicated. An alternative is to use
21+
[MetaConfigurator](https://www.metaconfigurator.org?schema=https://raw.githubusercontent.com/CycloneDX/tool-center/refs/heads/main/schemas/tool.schema.json&settings=https://raw.githubusercontent.com/CycloneDX/tool-center/refs/heads/main/metaConfiguratorSettings.json) to make changes then download the edited data.
2122

2223
## Community & Support
2324

docgen/gen.sh

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DESC="Generate HTML Schema navigator for CycloneDX Tool Center"
66

77
# Paths (adjust if needed)
88
THIS_PATH="$(realpath "$(dirname "$0")")"
9-
SCHEMA_PATH="$(realpath "$THIS_PATH/..")"
9+
SCHEMA_PATH="$(realpath "$THIS_PATH/../schemas")"
1010
DOCS_PATH="$THIS_PATH/docs"
1111
TEMPLATES_PATH="$THIS_PATH/templates"
1212

@@ -18,18 +18,15 @@ prepare () {
1818
fi
1919
}
2020

21-
generate () {
22-
local title="CycloneDX Tool Center JSON Reference"
23-
echo "Generating: $title"
24-
25-
local SCHEMA_FILE="$SCHEMA_PATH/tools.schema.json"
26-
echo "SCHEMA_FILE: $SCHEMA_FILE"
21+
clean () {
22+
rm -rf "$DOCS_PATH"
23+
mkdir -p "$DOCS_PATH"
24+
}
2725

28-
local OUT_FILE="$DOCS_PATH/index.html"
29-
local OUT_DIR
30-
OUT_DIR="$(dirname "$OUT_FILE")"
31-
rm -rf "$OUT_DIR"
32-
mkdir -p "$OUT_DIR"
26+
_generate () {
27+
local title="$1"
28+
local schema_file="$2"
29+
local out_file="$3"
3330

3431
# Generate HTML documentation from the JSON schema
3532
generate-schema-doc \
@@ -40,16 +37,33 @@ generate () {
4037
--config title="$title" \
4138
--config custom_template_path="$TEMPLATES_PATH/cyclonedx/base.html" \
4239
--minify \
43-
"$SCHEMA_FILE" \
44-
"$OUT_FILE"
40+
"$schema_file" \
41+
"$out_file"
4542

4643
# Update placeholders in the generated HTML
47-
sed -i -e "s/\${quotedTitle}/\"$title\"/g" "$OUT_FILE"
48-
sed -i -e "s/\${title}/$title/g" "$OUT_FILE"
44+
sed -i -e "s/\${quotedTitle}/\"$title\"/g" "$out_file"
45+
sed -i -e "s/\${title}/$title/g" "$out_file"
46+
}
47+
48+
49+
generate_tools () {
50+
_generate \
51+
"CycloneDX Tool Center v2 - Tools - JSON Reference"\
52+
"$SCHEMA_PATH/tools.schema.json" \
53+
"$DOCS_PATH/index.html"
54+
}
55+
56+
generate_tool () {
57+
_generate \
58+
"CycloneDX Tool Center v2 - Tool - JSON Reference"\
59+
"$SCHEMA_PATH/tool.schema.json" \
60+
"$DOCS_PATH/tool.html"
4961
}
5062

5163
# Main
5264
prepare
53-
generate
65+
clean
66+
generate_tools
67+
generate_tool
5468

5569
exit 0

docgen/templates/cyclonedx/base.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@
3333
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
3434
<span class="navbar-toggler-icon"></span>
3535
</button>
36+
<div class="collapse navbar-collapse" id="navbarScroll">
37+
<ul class="navbar-nav mr-auto my-2 my-lg-0 navbar-nav-scroll" style="max-height: 100px;">
38+
<li class="nav-item dropdown">
39+
<a class="nav-link dropdown-toggle" href="#" id="navbarScrollingDropdown" role="button" data-toggle="dropdown" aria-expanded="false">select a schema</a>
40+
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
41+
<li><a class="dropdown-item" href="index.html">Tools</a></li>
42+
<li><a class="dropdown-item" href="tool.html">Tool</a></li>
43+
</ul>
44+
</li>
45+
</ul>
46+
</div>
3647
</nav>
3748

3849

helpers/tools-assemble.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python3
2+
3+
from datetime import datetime, timezone
4+
from json import dump as json_dump, load as json_load
5+
from pathlib import Path
6+
7+
REPO_ROOT = Path(__file__).parent.parent
8+
TOOLS_JSON = REPO_ROOT / 'tools.json'
9+
TOOLS_FOLDER = REPO_ROOT / 'tools'
10+
11+
tools = []
12+
13+
license_ = {
14+
'id': 'CC-BY-SA-4.0',
15+
'name': 'Creative Commons Attribution-ShareAlike 4.0 International',
16+
'url': 'https://creativecommons.org/licenses/by-sa/4.0/'
17+
}
18+
19+
now = datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace('+00:00', 'Z')
20+
21+
for tfn in sorted(TOOLS_FOLDER.glob('*.json')):
22+
print('loading', tfn, '...')
23+
with open(tfn) as t:
24+
tool = json_load(t)
25+
tool['tool']['_fromFile'] = tfn.name
26+
tools.append(tool['tool'])
27+
28+
print('writing', TOOLS_JSON, '...')
29+
with open(TOOLS_JSON, 'w') as ts:
30+
json_dump({
31+
'$schema': 'https://cyclonedx.org/schema/tool-center-v2.schema.json',
32+
'specVersion': '2.0',
33+
'last_updated': now,
34+
'license': license_,
35+
'tools': tools
36+
}, ts, indent=2)

0 commit comments

Comments
 (0)