Skip to content

Instantly share code, notes, and snippets.

@romain-grecourt
Last active June 6, 2020 01:31
Show Gist options
  • Save romain-grecourt/53aa33539e4c96596d8392516d37cef2 to your computer and use it in GitHub Desktop.
Save romain-grecourt/53aa33539e4c96596d8392516d37cef2 to your computer and use it in GitHub Desktop.
Helidon CLI updates mechanism

Updates metadata

We need to handle updates for 3 different versions:

  • helidon
  • build-tools maven plugin
  • cli

metadata.properties:

helidon.version=2.0.0-RC2
build-tools.version=2.0.0-RC3
cli.version=2.0.0-RC1
cli.2.0.0-M2.message=Major devloop enhancements
cli.2.0.0-M4.message=Helidon archetype support
cli.2.0.0-RC1.message=Perf improvements

The cli changelog is encoded with properties with format cli.{cli-version}.message. The message is optional, version resolution is required to compile the list of message to display the notification.

Single zip archive to boostrap the init command

data.zip:

|- metadata.properties
|- archetype-catalog.xml
|- archetypeX

URLs

https://helidon.io/cli-data/latest (contains '2.0.0-RC3')
https://helidon.io/cli-data/2.0.0-RC3/cli-data.zip
https://helidon.io/cli-data/2.0.0-RC2/cli-data.zip

E.g. "https://helidon.io/cli-data/latest/cli-data.zip"

Algorithm

Cache directory

.helidon
  |- cache/
     |- latest (contains '2.0.0-RC2')
     |- 2.0.0-RC2
        |- .last_update (contains etag + timestamp of last check time) (TODO find a better name)
        |- metadata.properties
        |- archetype-catalog.xml
        |- archetypeX
     |- 2.0.0-RC1
        |- metadata.properties
        |- archetype-catalog.xml
        |- archetypeX

Use cases

End-user (cli)

# --version is not passed, "latest" Helidon needs to be resolved
helidon init
# --version is explicitly passed to an "older" version that is not the latest
helidon init --version 2.0.0-RC1

Helidon release

Deliver a CLI update

Deliver a Build Tools Maven Plugin update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment