From 7e03153f8ed63e276c007ecc04a50927be58225a Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Fri, 15 Dec 2023 13:55:52 -0500 Subject: [PATCH] Script the procedure for updating the site for new releases, and update for 1.5.1 --- .plano.py | 70 ++++++++++++++ README.md | 14 ++- config/config.py | 20 +++- config/releases.md.in | 36 +++++++ data/releases.json | 199 +++++++++++++++++++++++++++++++++++++++ docs/index.html | 2 +- docs/install/index.html | 14 +-- docs/releases/index.html | 77 +++++++-------- input/releases/index.md | 75 +++++++-------- 9 files changed, 417 insertions(+), 90 deletions(-) create mode 100644 config/releases.md.in create mode 100644 data/releases.json diff --git a/.plano.py b/.plano.py index cb501611..18287255 100644 --- a/.plano.py +++ b/.plano.py @@ -19,6 +19,8 @@ from transom.planocommands import * +import datetime as _datetime + site.output_dir = "docs" @command @@ -125,6 +127,65 @@ def generate_examples(output_file="input/examples/index.html.in"): write(output_file, "\n".join(out)) +@command +def generate_releases(output_file="input/releases/index.md"): + """ + Generate the release index using data from GitHub + """ + + _update_release_data() + + releases = read_json("data/releases.json") + latest_release_version = releases["latest_release"]["version"] + out = list() + + for release in releases["releases"]: + version = release["version"] + + if version == latest_release_version: + continue + + url = release["url"] + date = parse_timestamp(release["date"]) + + out.append(f"* [{version}]({url}) - {date.day} {date.strftime('%B %Y')}") + + releases = "\n".join(out) + markdown = read("config/releases.md.in").replace("@releases@", releases) + output_file = get_absolute_path(output_file) + + write(output_file, markdown) + +def _update_release_data(): + releases = http_get_json("https://api.github.com/repos/skupperproject/skupper/releases?per_page=100") + latest_release = http_get_json("https://api.github.com/repos/skupperproject/skupper/releases/latest") + + data = dict() + + latest_release_tag = latest_release["tag_name"] + + data["latest_release"] = { + "version": latest_release_tag, + "url": "https://github.com/skupperproject/skupper/releases/tag/{latest_release_tag}", + "date": latest_release["published_at"], + } + + data["releases"] = list() + + for release in releases: + if release["prerelease"] or release["draft"]: + continue + + release_tag = release["tag_name"] + + data["releases"].append({ + "version": release_tag, + "url": f"https://github.com/skupperproject/skupper/releases/tag/{release_tag}", + "date": release["published_at"], + }) + + write_json("data/releases.json", data) + @command def test(): render() @@ -136,3 +197,12 @@ def test(): run("cat docs/install.sh | sh", shell=True) generate_docs(output_dir=d) + +def parse_timestamp(timestamp, format="%Y-%m-%dT%H:%M:%SZ"): + if timestamp is None: + return None + + dt = _datetime.datetime.strptime(timestamp, format) + dt = dt.replace(tzinfo=_datetime.timezone.utc) + + return dt diff --git a/README.md b/README.md index 2ecf49a8..9732cdc5 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,12 @@ The process of publishing these docs to the Skupper website uses ## Updating the site for new Skupper releases -1. Update the `skupper_release` and `skupper_release_date` variables - in `config/config.py`. -2. Add an entry for the previous release to `releases/index.md` in the - "Previous releases" section. -3. Run `plano render --force` to update the site. +Run the `generate-releases` command: + +~~~ console +./plano generate-releases +./plano render --force +~~~ + +This fetches release data from GitHub and updates the site for new +releases. diff --git a/config/config.py b/config/config.py index 12f3fe0a..113d6a3a 100644 --- a/config/config.py +++ b/config/config.py @@ -1,6 +1,22 @@ +from plano import * + +import datetime as _datetime + def path_nav(page): links = " ".join(list(page.path_nav_links)[1:]) return f"" -skupper_release = "1.5.0" -skupper_release_date = "10 November 2023" +def _parse_timestamp(timestamp, format="%Y-%m-%dT%H:%M:%SZ"): + if timestamp is None: + return None + + dt = _datetime.datetime.strptime(timestamp, format) + dt = dt.replace(tzinfo=_datetime.timezone.utc) + + return dt + +_latest_release = read_json("data/releases.json")["latest_release"] +_latest_release_date = _parse_timestamp(_latest_release["date"]) + +skupper_release = _latest_release["version"] +skupper_release_date = f"{_latest_release_date.day} {_latest_release_date.strftime('%B %Y')}" diff --git a/config/releases.md.in b/config/releases.md.in new file mode 100644 index 00000000..39bf01e4 --- /dev/null +++ b/config/releases.md.in @@ -0,0 +1,36 @@ +--- +title: Releases +--- + +# Skupper releases + +## The latest release + +[Skupper {{skupper_release}}][release-page] was released on {{skupper_release_date}}. + +For Linux or the Mac, use the [install script][install-script] to +download and extract the Skupper command: + +
curl https://skupper.io/install.sh | sh
+ +The script installs the command under your home directory. It prompts +you to add the command to your path if necessary. + +For Windows and other installation options, see [Installing +Skupper](/install/index.html). + +[release-page]: https://github.com/skupperproject/skupper/releases/tag/{{skupper_release}} +[install-script]: https://github.com/skupperproject/skupper-website/blob/main/docs/install.sh + +## Previous releases + +
+ +@releases@ + +
+ +## More resources + +* [Skupper releases at GitHub](https://github.com/skupperproject/skupper/releases) +* [Skupper images at Quay.io](https://quay.io/organization/skupper) diff --git a/data/releases.json b/data/releases.json new file mode 100644 index 00000000..6d5f150d --- /dev/null +++ b/data/releases.json @@ -0,0 +1,199 @@ +{ + "latest_release": { + "date": "2023-12-06T13:33:03Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/{latest_release_tag}", + "version": "1.5.1" + }, + "releases": [ + { + "date": "2023-12-06T13:33:03Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.5.1", + "version": "1.5.1" + }, + { + "date": "2023-11-15T13:40:57Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.4.4", + "version": "1.4.4" + }, + { + "date": "2023-11-10T16:53:30Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.5.0", + "version": "1.5.0" + }, + { + "date": "2023-09-20T13:34:04Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.4.3", + "version": "1.4.3" + }, + { + "date": "2023-08-29T17:16:50Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.8", + "version": "1.2.8" + }, + { + "date": "2023-07-19T16:44:39Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.4.2", + "version": "1.4.2" + }, + { + "date": "2023-07-05T21:19:06Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.7", + "version": "1.2.7" + }, + { + "date": "2023-06-21T12:40:46Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.4.1", + "version": "1.4.1" + }, + { + "date": "2023-05-04T17:18:00Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.6", + "version": "1.2.6" + }, + { + "date": "2023-03-27T13:33:24Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.5", + "version": "1.2.5" + }, + { + "date": "2023-03-10T13:11:11Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.3.0", + "version": "1.3.0" + }, + { + "date": "2023-03-09T18:20:04Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.4", + "version": "1.2.4" + }, + { + "date": "2023-02-08T18:07:43Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.3", + "version": "1.2.3" + }, + { + "date": "2023-01-18T13:07:26Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.2", + "version": "1.2.2" + }, + { + "date": "2023-01-11T15:20:31Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.1", + "version": "1.2.1" + }, + { + "date": "2022-11-14T13:43:16Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.2.0", + "version": "1.2.0" + }, + { + "date": "2022-10-07T07:18:35Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.1.1", + "version": "1.1.1" + }, + { + "date": "2022-10-03T08:27:46Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.1.0", + "version": "1.1.0" + }, + { + "date": "2022-06-14T12:09:52Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.0.2", + "version": "1.0.2" + }, + { + "date": "2022-06-02T19:33:18Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.0.1", + "version": "1.0.1" + }, + { + "date": "2022-05-10T08:49:42Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/1.0.0", + "version": "1.0.0" + }, + { + "date": "2022-03-09T16:43:11Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.7", + "version": "0.8.7" + }, + { + "date": "2022-02-09T14:03:44Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.6", + "version": "0.8.6" + }, + { + "date": "2022-01-10T17:47:30Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.5", + "version": "0.8.5" + }, + { + "date": "2021-12-17T16:49:20Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.4", + "version": "0.8.4" + }, + { + "date": "2021-11-19T15:54:40Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.3", + "version": "0.8.3" + }, + { + "date": "2021-11-18T14:22:21Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.2", + "version": "0.8.2" + }, + { + "date": "2021-11-02T21:28:19Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.1", + "version": "0.8.1" + }, + { + "date": "2021-10-20T11:58:12Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.8.0", + "version": "0.8.0" + }, + { + "date": "2021-07-30T18:43:42Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.7.0", + "version": "0.7.0" + }, + { + "date": "2021-05-20T13:54:06Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.6.0", + "version": "0.6.0" + }, + { + "date": "2021-04-01T15:18:13Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.5.3", + "version": "0.5.3" + }, + { + "date": "2021-03-30T09:28:08Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.5.2", + "version": "0.5.2" + }, + { + "date": "2021-03-24T15:35:40Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.5.1", + "version": "0.5.1" + }, + { + "date": "2021-03-12T08:57:33Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.5.0", + "version": "0.5.0" + }, + { + "date": "2021-01-19T18:00:54Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.4.2", + "version": "0.4.2" + }, + { + "date": "2020-12-09T22:19:06Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.4.0", + "version": "0.4.0" + }, + { + "date": "2020-07-22T16:55:51Z", + "url": "https://github.com/skupperproject/skupper/releases/tag/0.3.0", + "version": "0.3.0" + } + ] +} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 0388d2ca..8c286970 100644 --- a/docs/index.html +++ b/docs/index.html @@ -335,7 +335,7 @@

Multicloud communication for Kubernetes

play_circle_filled Watch the video

info Learn more

flag Get started

-

Get Skupper 1.5.0 chevron_right

+

Get Skupper 1.5.1 chevron_right

diff --git a/docs/install/index.html b/docs/install/index.html index 349bd542..00e2ee33 100644 --- a/docs/install/index.html +++ b/docs/install/index.html @@ -88,21 +88,21 @@

Installing manually

Download the latest release

Select the latest release for your platform:

To get artifacts for other operating systems and architectures, see -the GitHub release page.

+the GitHub release page.

Extract the Skupper command

Use tar or unzip to extract the command from the release archive:

Linux or Mac
-
tar -xf skupper-cli-1.5.0-linux-amd64.tgz
+
tar -xf skupper-cli-1.5.1-linux-amd64.tgz
Windows
-
unzip skupper-cli-1.5.0-windows-amd64.zip
+
unzip skupper-cli-1.5.1-windows-amd64.zip

This produces an executable file named skupper in your current directory.

Place the command on your path

@@ -123,7 +123,7 @@

Check the command

To test your installation, run the skupper version command. You should see output like this:

$ skupper version
-client version                 1.5.0
+client version                 1.5.1
 transport version              not-found (no configuration has been provided)
 controller version             not-found (no configuration has been provided)

Upgrade sites

diff --git a/docs/releases/index.html b/docs/releases/index.html index a0b71d58..aeae4e44 100644 --- a/docs/releases/index.html +++ b/docs/releases/index.html @@ -77,7 +77,7 @@

Skupper releases

The latest release

-

Skupper 1.5.0 was released on 10 November 2023.

+

Skupper 1.5.1 was released on 6 December 2023.

For Linux or the Mac, use the install script to download and extract the Skupper command:

curl https://skupper.io/install.sh | sh
@@ -87,45 +87,46 @@

The latest release

For Windows and other installation options, see Installing Skupper.

Previous releases

-
+
diff --git a/input/releases/index.md b/input/releases/index.md index ce622613..ae4857c6 100644 --- a/input/releases/index.md +++ b/input/releases/index.md @@ -24,44 +24,45 @@ Skupper](/install/index.html). ## Previous releases -
+
-* [1.4.3](https://github.com/skupperproject/skupper/releases/tag/1.4.3) - September 2023 -* [1.4.2](https://github.com/skupperproject/skupper/releases/tag/1.4.2) - July 2023 -* [1.4.1](https://github.com/skupperproject/skupper/releases/tag/1.4.1) - June 2023 -* [1.3.0](https://github.com/skupperproject/skupper/releases/tag/1.3.0) - March 2023 -* [1.2.5](https://github.com/skupperproject/skupper/releases/tag/1.2.5) - March 2023 -* [1.2.4](https://github.com/skupperproject/skupper/releases/tag/1.2.4) - March 2023 -* [1.2.3](https://github.com/skupperproject/skupper/releases/tag/1.2.3) - February 2023 -* [1.2.2](https://github.com/skupperproject/skupper/releases/tag/1.2.2) - January 2023 -* [1.2.1](https://github.com/skupperproject/skupper/releases/tag/1.2.1) - January 2023 -* [1.2.0](https://github.com/skupperproject/skupper/releases/tag/1.2.0) - November 2022 -* [1.1.1](https://github.com/skupperproject/skupper/releases/tag/1.1.1) - October 2022 -* [1.1.0](https://github.com/skupperproject/skupper/releases/tag/1.1.0) - October 2022 -* [1.0.2](https://github.com/skupperproject/skupper/releases/tag/1.0.2) - June 2022 -* [1.0.1](https://github.com/skupperproject/skupper/releases/tag/1.0.1) - June 2022 -* [1.0.0](https://github.com/skupperproject/skupper/releases/tag/1.0.0) - May 2022 -* [0.8.7](https://github.com/skupperproject/skupper/releases/tag/0.8.7) - March 2022 -* [0.8.6](https://github.com/skupperproject/skupper/releases/tag/0.8.6) - February 2022 -* [0.8.5](https://github.com/skupperproject/skupper/releases/tag/0.8.5) - January 2022 -* [0.8.4](https://github.com/skupperproject/skupper/releases/tag/0.8.4) - December 2021 -* [0.8.3](https://github.com/skupperproject/skupper/releases/tag/0.8.3) - November 2021 -* [0.8.2](https://github.com/skupperproject/skupper/releases/tag/0.8.2) - November 2021 -* [0.8.1](https://github.com/skupperproject/skupper/releases/tag/0.8.1) - November 2021 -* [0.8.0](https://github.com/skupperproject/skupper/releases/tag/0.8.0) - October 2021 -* [0.7.0](https://github.com/skupperproject/skupper/releases/tag/0.7.0) - July 2021 -* [0.6.0](https://github.com/skupperproject/skupper/releases/tag/0.6.0) - May 2021 -* [0.5.3](https://github.com/skupperproject/skupper/releases/tag/0.5.3) - April 2021 -* [0.5.2](https://github.com/skupperproject/skupper/releases/tag/0.5.2) - March 2021 -* [0.5.1](https://github.com/skupperproject/skupper/releases/tag/0.5.1) - March 2021 -* [0.5.0](https://github.com/skupperproject/skupper/releases/tag/0.5.0) - March 2021 -* [0.4.2](https://github.com/skupperproject/skupper/releases/tag/0.4.2) - January 2021 -* [0.4.1](https://github.com/skupperproject/skupper/releases/tag/0.4.1) - January 2021 -* [0.4.0](https://github.com/skupperproject/skupper/releases/tag/0.4.0) - December 2020 -* [0.3.2](https://github.com/skupperproject/skupper/releases/tag/0.3.2) - September 2020 -* [0.3.1](https://github.com/skupperproject/skupper/releases/tag/0.3.1) - August 2020 -* [0.3.0](https://github.com/skupperproject/skupper/releases/tag/0.3.0) - July 2020 -* [0.2.0](https://github.com/skupperproject/skupper/releases-cli/tag/0.2.0) - April 2020 +* [1.4.4](https://github.com/skupperproject/skupper/releases/tag/1.4.4) - 15 November 2023 +* [1.5.0](https://github.com/skupperproject/skupper/releases/tag/1.5.0) - 10 November 2023 +* [1.4.3](https://github.com/skupperproject/skupper/releases/tag/1.4.3) - 20 September 2023 +* [1.2.8](https://github.com/skupperproject/skupper/releases/tag/1.2.8) - 29 August 2023 +* [1.4.2](https://github.com/skupperproject/skupper/releases/tag/1.4.2) - 19 July 2023 +* [1.2.7](https://github.com/skupperproject/skupper/releases/tag/1.2.7) - 5 July 2023 +* [1.4.1](https://github.com/skupperproject/skupper/releases/tag/1.4.1) - 21 June 2023 +* [1.2.6](https://github.com/skupperproject/skupper/releases/tag/1.2.6) - 4 May 2023 +* [1.2.5](https://github.com/skupperproject/skupper/releases/tag/1.2.5) - 27 March 2023 +* [1.3.0](https://github.com/skupperproject/skupper/releases/tag/1.3.0) - 10 March 2023 +* [1.2.4](https://github.com/skupperproject/skupper/releases/tag/1.2.4) - 9 March 2023 +* [1.2.3](https://github.com/skupperproject/skupper/releases/tag/1.2.3) - 8 February 2023 +* [1.2.2](https://github.com/skupperproject/skupper/releases/tag/1.2.2) - 18 January 2023 +* [1.2.1](https://github.com/skupperproject/skupper/releases/tag/1.2.1) - 11 January 2023 +* [1.2.0](https://github.com/skupperproject/skupper/releases/tag/1.2.0) - 14 November 2022 +* [1.1.1](https://github.com/skupperproject/skupper/releases/tag/1.1.1) - 7 October 2022 +* [1.1.0](https://github.com/skupperproject/skupper/releases/tag/1.1.0) - 3 October 2022 +* [1.0.2](https://github.com/skupperproject/skupper/releases/tag/1.0.2) - 14 June 2022 +* [1.0.1](https://github.com/skupperproject/skupper/releases/tag/1.0.1) - 2 June 2022 +* [1.0.0](https://github.com/skupperproject/skupper/releases/tag/1.0.0) - 10 May 2022 +* [0.8.7](https://github.com/skupperproject/skupper/releases/tag/0.8.7) - 9 March 2022 +* [0.8.6](https://github.com/skupperproject/skupper/releases/tag/0.8.6) - 9 February 2022 +* [0.8.5](https://github.com/skupperproject/skupper/releases/tag/0.8.5) - 10 January 2022 +* [0.8.4](https://github.com/skupperproject/skupper/releases/tag/0.8.4) - 17 December 2021 +* [0.8.3](https://github.com/skupperproject/skupper/releases/tag/0.8.3) - 19 November 2021 +* [0.8.2](https://github.com/skupperproject/skupper/releases/tag/0.8.2) - 18 November 2021 +* [0.8.1](https://github.com/skupperproject/skupper/releases/tag/0.8.1) - 2 November 2021 +* [0.8.0](https://github.com/skupperproject/skupper/releases/tag/0.8.0) - 20 October 2021 +* [0.7.0](https://github.com/skupperproject/skupper/releases/tag/0.7.0) - 30 July 2021 +* [0.6.0](https://github.com/skupperproject/skupper/releases/tag/0.6.0) - 20 May 2021 +* [0.5.3](https://github.com/skupperproject/skupper/releases/tag/0.5.3) - 1 April 2021 +* [0.5.2](https://github.com/skupperproject/skupper/releases/tag/0.5.2) - 30 March 2021 +* [0.5.1](https://github.com/skupperproject/skupper/releases/tag/0.5.1) - 24 March 2021 +* [0.5.0](https://github.com/skupperproject/skupper/releases/tag/0.5.0) - 12 March 2021 +* [0.4.2](https://github.com/skupperproject/skupper/releases/tag/0.4.2) - 19 January 2021 +* [0.4.0](https://github.com/skupperproject/skupper/releases/tag/0.4.0) - 9 December 2020 +* [0.3.0](https://github.com/skupperproject/skupper/releases/tag/0.3.0) - 22 July 2020