Skip to content

Commit f3ef334

Browse files
authored
Merge pull request #527 from cloudfoundry/inline-format-usn-log
CI: inline format-usn-log to build-release-metadata.sh
2 parents d2c8b20 + 2838c97 commit f3ef334

2 files changed

Lines changed: 14 additions & 23 deletions

File tree

ci/bin/format-usn-log

Lines changed: 0 additions & 12 deletions
This file was deleted.

ci/tasks/build-release-metadata.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ mkdir -p "${REPO_PARENT}/release-metadata"
1616
echo -n "${OS_NAME} ${OS_VERSION} v$version" > "${REPO_PARENT}/release-metadata/name"
1717
echo -n "${OS_NAME}-${OS_VERSION}/v$version" > "${REPO_PARENT}/release-metadata/tag"
1818

19-
install_jq() {
20-
pushd "$(mktemp -d)"
21-
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
22-
echo "c6b3a7d7d3e7b70c6f51b706a3b90bd01833846c54d32ca32f0027f00226ff6d jq-linux64" > jq.txt
23-
shasum -c jq.txt
24-
chmod +x jq-linux64
25-
mv jq-linux64 /usr/bin/jq
26-
popd
27-
}
19+
format_usn_log() {
20+
local usn_data=${1}
2821

29-
install_jq
22+
jq -r --slurp < "${usn_data}" '.[] |
23+
"
24+
**Title**: " + .title +"
25+
**URL**: " + .url +"
26+
**Priorities**: " + (.priorities | join(",")) +"
27+
**Description**:
28+
" + .description +"
29+
**CVEs**:
30+
" + (.cves | map(" - " + .) | join("\n"))
31+
'
32+
}
3033

3134
pushd "${REPO_PARENT}/candidate-stemcell"
3235
tar xvf bosh-stemcell-*-warden-boshlite-"${OS_NAME}"-"${OS_VERSION}"*.tgz packages.txt
@@ -57,7 +60,7 @@ if [[ "${OS_NAME}" == "ubuntu" ]]; then
5760
{
5861
echo ""
5962
echo "## USNs:"
60-
"${REPO_ROOT}/ci/bin/format-usn-log" "${usn_log_json_file}"
63+
format_usn_log "${usn_log_json_file}"
6164
} >> "${REPO_PARENT}/release-metadata/body"
6265
fi
6366

0 commit comments

Comments
 (0)