Skip to content

Commit 28929a4

Browse files
committed
feat: add SBOM downloads based on cut-off date
With this the SBOM downloads will be available for any release created after 2023-10-11. Both JSON and XML download links will be available. The Apache conventions for distributing these via dist.apache.org must be followed, so .asc and .sha512 files must be present in addition to the .json and .xml SBOM files. Resolves #1096
1 parent 2327833 commit 28929a4

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

data/release-categories.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ camel:
3636
- name: 'Sources'
3737
path_format: 'camel/apache-camel/{version}/apache-camel-{version}-src.zip'
3838
filename_format: 'apache-camel-{version}-src.zip'
39+
- name: 'SBOM, CycloneDX XML'
40+
path_format: 'camel/apache-camel/{version}/apache-camel-{version}-sbom.xml'
41+
filename_format: 'apache-camel-{version}-sbom.xml'
42+
- name: 'SBOM, CycloneDX JSON'
43+
path_format: 'camel/apache-camel/{version}/apache-camel-{version}-sbom.json'
44+
filename_format: 'apache-camel-{version}-sbom.json'
3945
camel-k:
4046
id: 'camel-k'
4147
name: 'Apache Camel-K'
@@ -72,6 +78,12 @@ camel-kamelets:
7278
- name: 'Sources'
7379
path_format: 'camel/camel-kamelets/{version}/camel-kamelets-sources-{version}.tar.gz'
7480
filename_format: 'camel-kamelets-sources-{version}.tar.gz'
81+
- name: 'SBOM, CycloneDX XML'
82+
path_format: 'camel/camel-kamelets/{version}/camel-kamelets-{version}-sbom.xml'
83+
filename_format: 'camel-kamelets-{version}-sbom.xml'
84+
- name: 'SBOM, CycloneDX JSON'
85+
path_format: 'camel/camel-kamelets/{version}/camel-kamelets-{version}-sbom.json'
86+
filename_format: 'camel-kamelets-{version}-sbom.json'
7587
camel-kafka-connector:
7688
id: 'camel-kafka-connector'
7789
name: 'Apache Camel Kafka Connector'
@@ -97,3 +109,9 @@ camel-quarkus:
97109
- name: 'Sources'
98110
path_format: 'camel/camel-quarkus/{version}/apache-camel-quarkus-{version}-src.zip'
99111
filename_format: 'apache-camel-quarkus-{version}-src.zip'
112+
- name: 'SBOM, CycloneDX XML'
113+
path_format: 'camel/camel-quarkus/{version}/apache-camel-quarkus-{version}-sbom.xml'
114+
filename_format: 'apache-camel-quarkus-{version}-sbom.xml'
115+
- name: 'SBOM, CycloneDX JSON'
116+
path_format: 'camel/camel-quarkus/{version}/apache-camel-quarkus-{version}-sbom.json'
117+
filename_format: 'apache-camel-quarkus-{version}-sbom.json'

layouts/partials/releases/downloads.html

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{{/* after 2018-11-10 we started using SHA512 */}}
22
{{ $sha1_cutoff := time "2018-11-10" }}
33

4+
{{/* from 2023-11-23 all releases have SBOM downloads */}}
5+
{{ $sbom_cutoff := time "2023-10-11" }}
6+
47
{{/* default base URLs for current releases */}}
58
{{ $artifact_base_url := "https://www.apache.org/dyn/closer.lua/" }}
69
{{ $meta_base_url := "https://downloads.apache.org/" }}
@@ -128,14 +131,22 @@ <h2 id="{{ $.Category.id }}"><a class="anchor" href="#{{ $.Category.id }}"></a>{
128131
{{ range $kind, $v := $version }}
129132
{{ $release_note := (index (where (where (where $.Pages "Section" "releases") ".Params.category" $.Category.id) ".Params.version" $v) 0) }}
130133
{{ $hash_extension := ".sha512" }}
134+
{{ $hash_name := "SHA512" }}
131135
{{ if le $release_note.Date $sha1_cutoff }}
132136
{{ $hash_extension = ".sha1" }}
137+
{{ $hash_name = "SHA1" }}
138+
{{ end }}
139+
{{ $downloads := $.Category.downloads}}
140+
{{ if lt $release_note.Date $sbom_cutoff }}
141+
{{/* removes SBOM downloads based on the cutoff date */}}
142+
{{ $downloads = collections.Where $downloads "name" "not in" "SBOM, CycloneDX XML" }} {{/* must match the name in data/release-categories.yaml */}}
143+
{{ $downloads = collections.Where $downloads "name" "not in" "SBOM, CycloneDX JSON" }} {{/* must match the name in data/release-categories.yaml */}}
133144
{{ end }}
134145

135146
<tr>
136147
{{ if eq $.Section "download" }}
137-
{{ if gt (len $.Category.downloads) 1 }}
138-
<td rowspan="{{ len $.Category.downloads }}">
148+
{{ if gt (len $downloads) 1 }}
149+
<td rowspan="{{ len $downloads }}">
139150
{{ else }}
140151
<td>
141152
{{ end }}
@@ -145,8 +156,8 @@ <h2 id="{{ $.Category.id }}"><a class="anchor" href="#{{ $.Category.id }}"></a>{
145156
<em class="kind">{{ . }}</em>
146157
{{ end }}
147158
</td>
148-
{{ if gt (len $.Category.downloads) 1 }}
149-
<td rowspan="{{ len $.Category.downloads }}">
159+
{{ if gt (len $downloads) 1 }}
160+
<td rowspan="{{ len $downloads }}">
150161
{{ else }}
151162
<td>
152163
{{ end }}
@@ -164,7 +175,7 @@ <h2 id="{{ $.Category.id }}"><a class="anchor" href="#{{ $.Category.id }}"></a>{
164175
{{ end }}
165176
</td>
166177
{{ end }}
167-
{{ range $idx, $download := $.Category.downloads }}
178+
{{ range $idx, $download := $downloads }}
168179
{{ if ne $idx 0 }}
169180
</tr><tr>
170181
{{ end }}

0 commit comments

Comments
 (0)