Skip to content

Add hack/update-template-almalinux.sh #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

norio-nomura
Copy link
Contributor

@norio-nomura norio-nomura commented Oct 24, 2024

$ hack/update-template-almalinux.sh
update-template-almalinux.sh: Update the AlmaLinux image location in the specified templates

Usage:
  update-template-almalinux.sh [--version-major <major version>] <template.yaml>...

Description:
  This script updates the AlmaLinux image location in the specified templates.
  If the image location in the template contains a minor version and release date in the URL,
  the script replaces it with the latest available minor version and date.

  Image location basename format:

        AlmaLinux-<major version>-GenericCloud-[latest|<major version>.<minor version>-<date>].<arch>.qcow2

  Published AlmaLinux image information is fetched from the following URLs:

    https://repo.almalinux.org/almalinux/<major version>/cloud/<arch>/images/

  To parsing html, this script requires 'htmlq' or 'pup' command.      
  The downloaded files will be cached in the Lima cache directory.

Examples:
  Update the AlmaLinux image location in templates/**.yaml:
  $ update-template-almalinux.sh templates/**.yaml

  Update the AlmaLinux image location in ~/.lima/almalinux/lima.yaml:
  $ update-template-almalinux.sh ~/.lima/almalinux/lima.yaml
  $ limactl factory-reset almalinux

  Update the AlmaLinux image location to major version 9 in ~/.lima/almalinux/lima.yaml:
  $ update-template-almalinux.sh --version-major 9 ~/.lima/almalinux/lima.yaml
  $ limactl factory-reset almalinux

Flags:
  --version-major <version>     Use the specified version. The version must be 8 or later.
  -h, --help              Print this help message

This PR aims to add AlmaLinux support as per #1347.

@norio-nomura
Copy link
Contributor Author

The implementation for detecting minor version upgrades is still needed.

@norio-nomura norio-nomura force-pushed the update-template-almalinux.sh branch 2 times, most recently from 2d0cd7d to 2afaa9c Compare October 25, 2024 02:45
@norio-nomura norio-nomura marked this pull request as ready for review October 25, 2024 02:47
@norio-nomura
Copy link
Contributor Author

norio-nomura commented Oct 25, 2024

  • implemented minor version updates
  • changed --version to --major-version
  • rewrote help message.

@AkihiroSuda AkihiroSuda added this to the v1.0 milestone Oct 25, 2024
@AkihiroSuda AkihiroSuda added guest/el8 Guest: CentOS 8 / Rocky Linux 8 / Alma Linux 8 guest/el9 labels Oct 25, 2024
@AkihiroSuda AkihiroSuda mentioned this pull request Oct 25, 2024
10 tasks
```console
$ hack/update-template-almalinux.sh
update-template-almalinux.sh: Update the AlmaLinux image location in the specified templates

Usage:
  update-template-almalinux.sh [--version-major <major version>] <template.yaml>...

Description:
  This script updates the AlmaLinux image location in the specified templates.
  If the image location in the template contains a minor version and release date in the URL,
  the script replaces it with the latest available minor version and date.

  Image location basename format:

        AlmaLinux-<major version>-GenericCloud-[latest|<major version>.<minor version>-<date>].<arch>.qcow2

  Published AlmaLinux image information is fetched from the following URLs:

    https://repo.almalinux.org/almalinux/<major version>/cloud/<arch>/images/

  To parsing html, this script requires 'htmlq' or 'pup' command.
  The downloaded files will be cached in the Lima cache directory.

Examples:
  Update the AlmaLinux image location in templates/**.yaml:
  $ update-template-almalinux.sh templates/**.yaml

  Update the AlmaLinux image location in ~/.lima/almalinux/lima.yaml:
  $ update-template-almalinux.sh ~/.lima/almalinux/lima.yaml
  $ limactl factory-reset almalinux

  Update the AlmaLinux image location to major version 9 in ~/.lima/almalinux/lima.yaml:
  $ update-template-almalinux.sh --version-major 9 ~/.lima/almalinux/lima.yaml
  $ limactl factory-reset almalinux

Flags:
  --version-major <version>     Use the specified version. The version must be 8 or later.
  -h, --help              Print this help message
```

Signed-off-by: Norio Nomura <[email protected]>
@norio-nomura norio-nomura force-pushed the update-template-almalinux.sh branch from 2afaa9c to 44f2d95 Compare October 25, 2024 03:16
@norio-nomura
Copy link
Contributor Author

fixed an issue where re-downloading was not working for pages that do not return a Last-Modified header.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit d750162 into lima-vm:master Oct 25, 2024
28 checks passed
@norio-nomura norio-nomura deleted the update-template-almalinux.sh branch October 25, 2024 21:53
@norio-nomura
Copy link
Contributor Author

Thanks! 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guest/el8 Guest: CentOS 8 / Rocky Linux 8 / Alma Linux 8 guest/el9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants