| #!/usr/bin/python |
| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| # |
| |
| from generate import * |
| |
| from datetime import datetime |
| |
| source_artefact_records = ( |
| ("qpid-java-{}.tar.gz", "Qpid Broker for Java, Qpid JMS for AMQP 0-9-1/0-10"), |
| ) |
| |
| binary_artefact_records = ( |
| ("qpid-broker-{}-bin.tar.gz", "Qpid Broker for Java"), |
| ("qpid-client-{}-bin.tar.gz", "Qpid JMS for AMQP 0-9-1/0-10"), |
| ) |
| |
| component_records = ( |
| ("broker-j", "Qpid Broker for Java", "Java", "JVM", "1.0, 0-10, 0-9-1, 0-9, 0-8"), |
| ("jms/amqp-0-x.html","Qpid JMS for AMQP 0-9-1/0-10", "Java", "JVM", "0-10, 0-9-1, 0-9, 0-8") |
| ) |
| |
| documentation = \ |
| """ |
| <div class="two-column" markdown="1"> |
| |
| - [Installing Qpid Broker for Java](java-broker/book/Java-Broker-Installation.html) |
| - [Broker book](java-broker/book/index.html) |
| - [JMS API reference](http://docs.oracle.com/javaee/1.4/api/javax/jms/package-summary.html) |
| - [Using the Qpid JMS client for AMQP 0-10](jms-client-0-10/book/index.html) |
| - [Using the Qpid JMS client for AMQP 0-9-1](jms-client-0-8/book/index.html) |
| - [JMS examples for AMQP 0-10](qpid-jms/examples/index.html) |
| - [JMS examples for AMQP 0-9-1, 0-9, 0-8](jms-client-0-8/book/JMS-Client-0-8-Examples.html) |
| |
| </div> |
| """ |
| |
| template = \ |
| """ |
| ;; |
| ;; Licensed to the Apache Software Foundation (ASF) under one |
| ;; or more contributor license agreements. See the NOTICE file |
| ;; distributed with this work for additional information |
| ;; regarding copyright ownership. The ASF licenses this file |
| ;; to you under the Apache License, Version 2.0 (the |
| ;; "License"); you may not use this file except in compliance |
| ;; with the License. You may obtain a copy of the License at |
| ;; |
| ;; http://www.apache.org/licenses/LICENSE-2.0 |
| ;; |
| ;; Unless required by applicable law or agreed to in writing, |
| ;; software distributed under the License is distributed on an |
| ;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ;; KIND, either express or implied. See the License for the |
| ;; specific language governing permissions and limitations |
| ;; under the License. |
| ;; |
| |
| #Qpid for Java {release} |
| |
| Qpid for Java offers an AMQP-fluent implementation of JMS and a message |
| broker written in Java that stores, routes, and forwards messages |
| using AMQP. More about [Qpid]({{{{site_url}}}}/index.html). |
| |
| For a detailed list of the changes in this release, see the [release |
| notes](release-notes.html). |
| |
| It's important to [verify the |
| integrity]({{{{site_url}}}}/download.html#verify-what-you-download) of the |
| files you download. |
| |
| ## Source archives |
| |
| | Content | Download | Verify | |
| |---------|----------|--------| |
| {source_artefacts} |
| |
| ## Binaries |
| |
| | Content | Download | Verify | |
| |---------|----------|--------| |
| {binary_artefacts} |
| |
| ## Components |
| |
| | Component | Languages | Platforms | AMQP versions | |
| |-----------|-----------|-----------|---------------| |
| {components} |
| |
| ## Documentation |
| |
| {documentation} |
| |
| ## More information |
| |
| - [All release artefacts](http://archive.apache.org/dist/qpid/java/{release}) |
| - [Resolved issues in JIRA]({issues_url}) |
| - [Source repository tag](https://gitbox.apache.org/repos/asf/qpid-broker-j.git/tree/refs/tags/{release}) |
| - [GitHub mirror](https://github.com/apache/qpid-broker-j/tree/{release}) |
| |
| <script type="text/javascript"> |
| _deferredFunctions.push(function() {{ |
| if ("{release}" === "{{{{current_java_release}}}}") {{ |
| _modifyCurrentReleaseLinks(); |
| }} |
| }}); |
| </script> |
| """ |
| |
| def gen_release_page(release, issues_release, source_release, release_dir): |
| output_path = join(release_dir, "index.md") |
| |
| components = list() |
| |
| source_artefacts = list() |
| source_artefact_url = "http://archive.apache.org/dist/qpid/java/{}/{}" |
| source_artefact_url_https = "https://archive.apache.org/dist/qpid/java/{}/{}" |
| |
| binary_artefacts = list() |
| binary_artefact_url = "http://archive.apache.org/dist/qpid/java/{}/binaries/{}" |
| binary_artefact_url_https = "https://archive.apache.org/dist/qpid/java/{}/binaries/{}" |
| |
| for artefact, summary in source_artefact_records: |
| artefact = artefact.format(release) |
| artefact_url = source_artefact_url.format(release, artefact) |
| artefact_url_https = source_artefact_url_https.format(release, artefact) |
| asc_url = "{}.asc".format(artefact_url_https) |
| sha_url = "{}.sha512".format(artefact_url_https) |
| |
| args = summary, artefact, artefact_url, asc_url, sha_url |
| row = "| {} | [{}]({}) | [ASC]({}), [SHA512]({}) |".format(*args) |
| |
| source_artefacts.append(row) |
| |
| for artefact, summary in binary_artefact_records: |
| artefact = artefact.format(release) |
| artefact_url = binary_artefact_url.format(release, artefact) |
| artefact_url_https = binary_artefact_url_https.format(release, artefact) |
| asc_url = "{}.asc".format(artefact_url_https) |
| sha_url = "{}.sha512".format(artefact_url_https) |
| |
| args = summary, artefact, artefact_url, asc_url, sha_url |
| row = "| {} | [{}]({}) | [ASC]({}), [SHA512]({}) |".format(*args) |
| |
| binary_artefacts.append(row) |
| |
| for key, name, languages, platforms, amqp_versions in component_records: |
| if key.endswith(".html"): |
| link = "[{}]({{{{site_url}}}}/components/{})".format(name, key) |
| else: |
| link = "[{}]({{{{site_url}}}}/components/{}/index.html)".format(name, key) |
| args = link, languages, platforms, amqp_versions |
| components.append("| {} | {} | {} | {} |".format(*args)) |
| |
| source_artefacts = "\n".join(source_artefacts) |
| binary_artefacts = "\n".join(binary_artefacts) |
| components = "\n".join(components) |
| |
| jql = "project = QPID AND fixVersion = '{}' AND resolution = 'fixed' ORDER BY priority DESC".format(issues_release) |
| issues_url = "https://issues.apache.org/jira/issues/?jql={}".format(urllib.parse.quote_plus(jql)) |
| |
| vars = locals() |
| vars["documentation"] = documentation |
| |
| output = template.format(**vars) |
| output = output.strip() |
| |
| write(output_path, output) |
| |
| trunk_template = """ |
| ;; |
| ;; Licensed to the Apache Software Foundation (ASF) under one |
| ;; or more contributor license agreements. See the NOTICE file |
| ;; distributed with this work for additional information |
| ;; regarding copyright ownership. The ASF licenses this file |
| ;; to you under the Apache License, Version 2.0 (the |
| ;; "License"); you may not use this file except in compliance |
| ;; with the License. You may obtain a copy of the License at |
| ;; |
| ;; http://www.apache.org/licenses/LICENSE-2.0 |
| ;; |
| ;; Unless required by applicable law or agreed to in writing, |
| ;; software distributed under the License is distributed on an |
| ;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ;; KIND, either express or implied. See the License for the |
| ;; specific language governing permissions and limitations |
| ;; under the License. |
| ;; |
| |
| # Qpid for Java documentation snapshot |
| |
| <div class="feature" markdown="1">n |
| |
| ## Warning! This is a snapshot of work in progress |
| |
| Documentation found here may be incorrect or incomplete. For a |
| smoother experience, see the [current stable |
| release]({{{{current_java_release_url}}}}/index.html). |
| |
| This content was generated at {time} on {day}, {date}. |
| |
| </div> |
| |
| ## Documentation |
| |
| {documentation} |
| |
| ## More information |
| |
| - [Source repository](https://gitbox.apache.org/repos/asf/qpid-broker-j.git) |
| - [GitHub mirror](https://github.com/apache/qpid-broker-j) |
| """ |
| |
| def gen_trunk_release_page(release_dir): |
| output_path = join(release_dir, "index.md") |
| |
| now = datetime.now() |
| |
| day = now.strftime("%A") |
| date = now.strftime("%d %B %Y") |
| time = now.strftime("%H:%M %Z") |
| |
| vars = locals() |
| vars["documentation"] = documentation |
| |
| output = trunk_template.format(**vars) |
| output = output.strip() |
| |
| write(output_path, output) |
| |
| ## Now do stuff ## |
| |
| release, issues_release, source_release, release_dir, checkout_dir = setup_release_script() |
| |
| if release == "trunk": |
| gen_trunk_release_page(release_dir) |
| else: |
| gen_release_page(release, issues_release, source_release, release_dir) |
| |
| notice("Release page generated") |