opentofu / get.opentofu.org

The website hosting the OpenTofu Installer script and installation resources
Apache License 2.0
3 stars 8 forks source link

Statically generating opentofu releases page: Fixes opentofu/opentofu#1131 #22

Closed sanskruti-shahu closed 2 months ago

sanskruti-shahu commented 4 months ago

Objective

The objective of this PR is to introduce a statically generated releases page for the opentofu.

Changes

Continuation of #16

sanskruti-shahu commented 4 months ago

Hey @janosdebugs , For these changes to be reflected correctly you need to change/add the build command as go run releases_page/main.go wherever this opentofu/get.opentofu.org is hosted on cloudflare. This ensures that the main.go file is executed during the build stage, generating all necessary HTML pages.

I did same thing with my forked of opentofu/get.opentofu.org, (on my personal cloudflare acount) I added build command as go run releases_page/main.go so I got the expected result.

Preview url: https://get-opentofu-org.pages.dev/

sanskruti-shahu commented 4 months ago

Hey @janosdebugs , I have implemented the changes you requested. Could you please review them again?

janosdebugs commented 4 months ago

Hey @sanskruti-shahu please make sure that:

  1. You handle ALL exit paths (i.e. close files before all return statements).
  2. When you have written a file, always handle errors on Close. With some filesystems you only get an error on Close, not when writing the file.

Please request a re-review once you have completed this for all code branches.

sanskruti-shahu commented 4 months ago

Hey @janosdebugs , According to me I have implemented the mentioned changes, Please let me know if there's still anything missing. Thanks.

sanskruti-shahu commented 4 months ago

@janosdebugs , Gentle reminder.

janosdebugs commented 3 months ago

Note for my fellow reviewer: this code now generates the content, but we will still need to add a GitHub Actions integration. I would recommend merging into a feature branch and work from there.