Skip to content
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

Add hack/update-template-ubuntu.sh #2702

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

norio-nomura
Copy link
Contributor

$ hack/update-ubuntu-image.sh --help
update-ubuntu-image.sh: Update the Ubuntu image location in the specified templates

Usage:
  update-ubuntu-image.sh [--minimal|--server] [--version <version>] <template.yaml>...

Description:
  This script updates the Ubuntu image location in the specified templates.
  If the image location in the template contains a release date in the URL, the script replaces it with the latest available date.
  If no flags are specified, the script uses the flavor and version from the image location basename in the template.

  Image location basename format: ubuntu-<version>-<flavor>-cloudimg-<arch>.img

  Released Ubuntu image information is fetched from the following URLs:

    Server: https://cloud-images.ubuntu.com/releases/stream/v1/com.ubuntu.cloud:released:download.json
    Minimal: https://cloud-images.ubuntu.com/minimal/releases/stream/v1/com.ubuntu.cloud:released:download.json

  The downloaded JSON file will be cached in the Lima cache directory.

Examples:
  Update the Ubuntu image location in templates/**.yaml:
  $ update-ubuntu-image.sh templates/**.yaml

  Update the Ubuntu image location in ~/.lima/ubuntu/lima.yaml:
  $ update-ubuntu-image.sh ~/.lima/ubuntu/lima.yaml

  Update the Ubuntu image location to ubuntu-24.04-minimal-cloudimg-<arch>.img in ~/.lima/docker/lima.yaml:
  $ update-ubuntu-image.sh --minimal --version 24.04 ~/.lima/docker/lima.yaml

Flags:
  --server             Use the server flavor image
  --minimal            Use the minimal flavor image
  --version <version>  Use the specified version
  -h, --help           Print this help message

@AkihiroSuda AkihiroSuda mentioned this pull request Oct 8, 2024
10 tasks
@AkihiroSuda
Copy link
Member

Could you squash the commits?

```console
$ hack/update-template-ubuntu.sh
update-template-ubuntu.sh: Update the Ubuntu image location in the specified templates

Usage:
  update-template-ubuntu.sh [--flavor <flavor>|--minimal|--server] [--version <version>] <template.yaml>...

Description:
  This script updates the Ubuntu image location in the specified templates.
  If the image location in the template contains a release date in the URL, the script replaces it with the latest available date.
  If no flags are specified, the script uses the flavor and version from the image location basename in the template.

  Image location basename format: ubuntu-<version>-<flavor>-cloudimg-<arch>.img

  Released Ubuntu image information is fetched from the following URLs:

    Server: https://cloud-images.ubuntu.com/releases/stream/v1/com.ubuntu.cloud:released:download.json
    Minimal: https://cloud-images.ubuntu.com/minimal/releases/stream/v1/com.ubuntu.cloud:released:download.json

  The downloaded JSON file will be cached in the Lima cache directory.

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

  Update the Ubuntu image location in ~/.lima/ubuntu/lima.yaml:
  $ update-template-ubuntu.sh ~/.lima/ubuntu/lima.yaml

  Update the Ubuntu image location to ubuntu-24.04-minimal-cloudimg-<arch>.img in ~/.lima/docker/lima.yaml:
  $ update-template-ubuntu.sh --minimal --version 24.04 ~/.lima/docker/lima.yaml

Flags:
  --flavor <flavor>    Use the specified flavor image
  --server             Shortcut for --flavor server
  --minimal            Shortcut for --flavor minimal
  --version <version>  Use the specified version
  -h, --help           Print this help message
```

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>

hack/update-ubuntu-image.sh: add `--flavor <flavor>` flag

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>

rename to `hack/update-template-ubuntu.sh`

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
@norio-nomura norio-nomura force-pushed the update-ubuntu-image.sh branch from 48fdad4 to 7bf550a Compare October 9, 2024 23:48
@norio-nomura
Copy link
Contributor Author

squashed and rebased on master.

@AkihiroSuda AkihiroSuda changed the title Add hack/update-ubuntu-image.sh Add hack/update-template-ubuntu.sh Oct 9, 2024
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 added this to the v1.0 milestone Oct 10, 2024
@AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda merged commit faf72aa into lima-vm:master Oct 10, 2024
26 of 27 checks passed
@norio-nomura
Copy link
Contributor Author

Thanks! 🙏🏻

@norio-nomura norio-nomura deleted the update-ubuntu-image.sh branch October 10, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants