Commit cfa32540 authored by Oliver Pinter's avatar Oliver Pinter
Browse files

HBSD: simplify the release process



Add a helper script to fetch the metadata from the jenkins server.
The NOTES file still should be filled manually, but the formatting is
done with the newer update_meta.py stuff.
Signed-off-by: default avatarOliver Pinter <oliver.pinter@hardenedbsd.org>
parent 509dc95d
#!/usr/bin/env tcsh
set URL_TEMPLATE="https://installer.hardenedbsd.org/pub/HardenedBSD/releases/amd64/amd64/ISO-IMAGES/"
set VERSION=`basename $PWD`
if ${VERSION} !~ "HardenedBSD-*" then
echo "Wrong directory, failed to detect release version"
exit 1
endif
foreach file ( CHECKSUM.SHA512 CHECKSUM.SHA512.asc )
fetch -o ${file} "${URL_TEMPLATE}/${VERSION}/${file}"
ln -v ${file}{,.txt}
end
......@@ -203,44 +203,48 @@ if ( ${_ok} != "yes" ) then
endif
echo "post processing changelog"
echo "${_tag} - https://github.com/HardenedBSD/hardenedBSD-stable/releases/tag/${_tag}"> ${gen_prefix}/drupal-${_tag}.txt
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<strong>Highlights:</strong>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<ul>" >> ${gen_prefix}/drupal-${_tag}.txt
echo " <li>...</li>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "</ul>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<strong>Installer images:</strong>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "http://installer.hardenedbsd.org/pub/HardenedBSD/releases/amd64/amd64/ISO-IMAGES/${_tag}/" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<strong>CHECKSUM.SHA512:</strong>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<strong>CHECKSUM.SHA512.asc:</strong>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.txt
awk 'BEGIN{print "<strong>Changelog:</strong>"; c=0; prev_c=0}; /^[A-Za-z]/{if (c != prev_c) {print "</ul>"; print "<br>"; prev_c = c}; print "<strong>"; print; print "</strong>"; print "<ul>"; c++}; /^[ ]/{print "\t<li>"; print; print "\t</li>"}; END{print "</ul>"}' ${gen_prefix}/shortlog-${_tag}.txt >> ${gen_prefix}/drupal-${_tag}.txt
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.txt
echo "Highlights:" > ${gen_prefix}/github-${_tag}.txt
echo " * ..." >> ${gen_prefix}/github-${_tag}.txt
echo >> ${gen_prefix}/github-${_tag}.txt
echo "Changelog" >> ${gen_prefix}/github-${_tag}.txt
echo "~~~" >> ${gen_prefix}/github-${_tag}.txt
cat ${gen_prefix}/shortlog-${_tag}.txt >> ${gen_prefix}/github-${_tag}.txt
echo "~~~" >> ${gen_prefix}/github-${_tag}.txt
echo >> ${gen_prefix}/github-${_tag}.txt
echo "Installer images: http://installer.hardenedbsd.org/pub/HardenedBSD/releases/amd64/amd64/ISO-IMAGES/${_tag}/" >> ${gen_prefix}/github-${_tag}.txt
echo >> ${gen_prefix}/github-${_tag}.txt
echo "CHECKSUM.SHA512:" >> ${gen_prefix}/github-${_tag}.txt
echo "~~~" >> ${gen_prefix}/github-${_tag}.txt
echo "~~~" >> ${gen_prefix}/github-${_tag}.txt
echo >> ${gen_prefix}/github-${_tag}.txt
echo "CHECKSUM.SHA512.asc:" >> ${gen_prefix}/github-${_tag}.txt
echo "~~~" >> ${gen_prefix}/github-${_tag}.txt
echo "~~~" >> ${gen_prefix}/github-${_tag}.txt
echo "${_tag} - https://github.com/HardenedBSD/hardenedBSD-stable/releases/tag/${_tag}"> ${gen_prefix}/drupal-${_tag}.template
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<strong>Highlights:</strong>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<ul>" >> ${gen_prefix}/drupal-${_tag}.template
echo "%%NOTES%%" >> ${gen_prefix}/drupal-${_tag}.template
echo "</ul>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<strong>Installer images:</strong>" >> ${gen_prefix}/drupal-${_tag}.template
echo "http://installer.hardenedbsd.org/pub/HardenedBSD/releases/amd64/amd64/ISO-IMAGES/${_tag}/" >> ${gen_prefix}/drupal-${_tag}.template
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<strong>CHECKSUM.SHA512:</strong>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "%%CHECKSUM%%" >> ${gen_prefix}/drupal-${_tag}.template
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<strong>CHECKSUM.SHA512.asc:</strong>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "%%SIGNATURE%%" >> ${gen_prefix}/drupal-${_tag}.template
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<br>" >> ${gen_prefix}/drupal-${_tag}.template
echo "<code>" >> ${gen_prefix}/drupal-${_tag}.template
awk 'BEGIN{print "<strong>Changelog:</strong>"; c=0; prev_c=0}; /^[A-Za-z]/{if (c != prev_c) {print "</ul>"; print "<br>"; prev_c = c}; print "<strong>"; print; print "</strong>"; print "<ul>"; c++}; /^[ ]/{print "\t<li>"; print; print "\t</li>"}; END{print "</ul>"}' ${gen_prefix}/shortlog-${_tag}.template >> ${gen_prefix}/drupal-${_tag}.template
echo "</code>" >> ${gen_prefix}/drupal-${_tag}.template
echo "Highlights:" > ${gen_prefix}/github-${_tag}.template
echo "%%NOTES%%" >> ${gen_prefix}/github-${_tag}.template
echo >> ${gen_prefix}/github-${_tag}.template
echo "Changelog" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
cat ${gen_prefix}/shortlog-${_tag}.template >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
echo >> ${gen_prefix}/github-${_tag}.template
echo "Installer images: http://installer.hardenedbsd.org/pub/HardenedBSD/releases/amd64/amd64/ISO-IMAGES/${_tag}/" >> ${gen_prefix}/github-${_tag}.template
echo >> ${gen_prefix}/github-${_tag}.template
echo "CHECKSUM.SHA512:" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
echo "%%CHECKSUM%%" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
echo >> ${gen_prefix}/github-${_tag}.template
echo "CHECKSUM.SHA512.asc:" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
echo "%%SIGNATURE%%" >> ${gen_prefix}/github-${_tag}.template
echo "~~~" >> ${gen_prefix}/github-${_tag}.template
echo "post processing changelog done"
echo
echo "done."
#!/usr/bin/env python3.6
import os
import os.path
cwd = os.path.basename(os.getcwd())
with open("CHECKSUM.SHA512", "r") as f:
checksum = f.read()
with open("CHECKSUM.SHA512.asc", "r") as f:
signature = f.read()
with open("drupal-{version}.template".format(version=cwd), "r") as f:
drupal_template = f.read()
with open("github-{version}.template".format(version=cwd), "r") as f:
github_template = f.read()
github_formatted_lines = []
drupal_formatted_lines = []
f_notes = open("NOTES", "r")
for line in f_notes:
formatted_line = line.replace("\n", "")
github_formatted_line = [ " * " + formatted_line ]
github_formatted_lines += github_formatted_line
drupal_formatted_line = [ " <li>" + formatted_line + "</li>" ]
drupal_formatted_lines += drupal_formatted_line
f_notes.close()
github_text = "\n".join(github_formatted_lines)
drupal_text = "\n".join(drupal_formatted_lines)
with open("drupal-{version}.txt".format(version=cwd), "w+") as f:
drupal = (drupal_template
.replace("%%NOTES%%", drupal_text)
.replace("%%CHECKSUM%%", checksum)
.replace("%%SIGNATURE%%", signature)
)
f.write(drupal)
with open("github-{version}.txt".format(version=cwd), "w+") as f:
github = (github_template
.replace("%%NOTES%%", github_text)
.replace("%%CHECKSUM%%", checksum)
.replace("%%SIGNATURE%%", signature)
)
f.write(github)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment