Sign inSign up

keinos/explode_version

By keinos

Updated over 7 years ago

Explodes version tag to JSON

Image
0

844

keinos/explode_version repository overview

Build Status Docker Cloud Build Status

Explode Version Number to JSON

The explode_version command (or the script) explodes a given version info in to JSON object string.

Useful to get version info into tokens for versioning. Mostly aimed to use for DockerHub's tag list.

For example, the string "php:7.3.4-cli-alpine3.9" becomes as below:

{
    "php": {
        "name": "php",
        "version": "7.3.4"
    },
    "cli": {
        "name": "cli"
    },
    "alpine": {
        "name": "alpine",
        "version": "3.9"
    }
}

Usage

For NON Docker Users:
For Docker Users:
  • Docker Image: keinos/explode_version @ Docker Hub

  • Repositories:

  • Sample usage:

    $ # With --pretty option
    $ docker run --rm keinos/explode_version --pretty "php:7.3.4-cli-alpine3.9"
    {
        "php": {
            "name": "php",
            "version": "7.3.4"
        },
        "cli": {
            "name": "cli"
        },
        "alpine": {
            "name": "alpine",
            "version": "3.9"
        }
    }
    $
    $ # With no option
    $ docker run --rm keinos/explode_version php7.0.1-cli-alpine3.0
    {"php":{"name":"php","version":"7.0.1"},"cli":{"name":"cli"},"alpine":{"name":"alpine","version":"3.0"}}
    
  • See: README_DOCKER.md for more

Help

$ ./explode_version --help
Usage: explode_version [OPTION] VERSION

OPTION:
  -h, --help    This help.
      --pretty  Outputs with indentation.

VERSION: A string to be alanlized.

Tag summary

Content type

Image

Digest

Size

6 MB

Last updated

over 7 years ago

docker pull keinos/explode_version