upgradeGithubRelease

1. Help

Command: bin/upgradeGithubRelease --help

SYNOPSIS:
    Retrieve latest binary release from github and install it.

USAGE: upgradeGithubRelease [OPTIONS] [ARGUMENTS]
USAGE: upgradeGithubRelease [--help|-h] [--config]
  [--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
  [--log-level <log-level>] [--log-file <log-file>]
  [--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
  [--quiet|-q] [--version-arg <versionArg>]
  [--current-version|-c <currentVersion>] [--exact-version|-e <exactVersion>]

ARGUMENTS:
  targetFile {single} (mandatory)    The binary downloaded will be written to this file path. Ensure the path
    is writable.
  githubUrlPattern {single} (mandatory)    The url pattern to use to download the binary, see examples below.
    @version@ is template variable that will be replaced by the latest
      version tag found on github.

GLOBAL OPTIONS:
  --help, -h {single}
    Displays this command help
  --config {single}
    Displays configuration
  --bash-framework-config <bash-framework-config> {single}
    Use alternate bash framework configuration.
  --verbose, -v {single}
    Info level verbose mode (alias of --display-level INFO)
  -vv {single}
    Debug level verbose mode (alias of --display-level DEBUG)
  -vvv {single}
    Trace level verbose mode (alias of --display-level TRACE)
  --log-level <log-level> {single}
    Set log level
    Possible values: 
      - OFF
      - ERR
      - ERROR
      - WARN
      - WARNING
      - INFO
      - DEBUG
      - TRACE
    Default value: OFF
  --log-file <log-file> {single}
    Set log file
    Default value: /logs/bash.log
  --display-level <display-level> {single}
    Set display level
    Possible values: 
      - OFF
      - ERR
      - ERROR
      - WARN
      - WARNING
      - INFO
      - DEBUG
      - TRACE
    Default value: INFO
  --no-color {single}
    Produce monochrome output. alias of --theme noColor.
  --theme <theme> {single}
    Choose color theme - default-force means colors will be produced even if
    command is piped.
    Possible values: 
      - default
      - default-force
      - noColor
    Default value: default
  --version {single}
    Print version information and quit.
  --quiet, -q {single}
    Quiet mode, doesn't display any output.

VERSION MANAGEMENT:
  --version-arg <versionArg> {single}
    The argument that will be provided to the currently installed binary
    to check the version of the software. See options constraints below.

    Default value: --version
  --current-version, -c <currentVersion> {single}
    Sometimes the command to retrieve the version is complicated.
    Some command needs you to parse json or other commands
    that provides multiple sub command versions.
    In this case you can provide the version you currently have.
    See options constraints and examples below.
  --exact-version, -e <exactVersion> {single}
    If provided and currently installed binary is not this exactVersion,
    this exact version of the binary will be installed.
    See options constraints below.


DESCRIPTION:
  GITHUB TEMPLATE URLS EXAMPLES:

    Simple ones(Sometimes @version@ template variable has to be specified twice):
    "https://github.com/hadolint/hadolint/releases/download/v@version@/hadolint-Linux-x86_64"
    "https://github.com/koalaman/shellcheck/releases/download/v@version@/shellcheck-v@[email protected]_64.tar.xz"
    "https://github.com/sharkdp/fd/releases/download/v@version@/fd_@version@_amd64.deb"
    "https://github.com/sharkdp/bat/releases/download/v@version@/bat_@version@_amd64.deb"
    "https://github.com/kubernetes-sigs/kind/releases/download/v@version@/kind-linux-amd64"
    "https://github.com/kubernetes/minikube/releases/download/v@version@/minikube-linux-amd64"
    "https://github.com/plantuml/plantuml/releases/download/v@version@/plantuml-@[email protected]"
    "https://github.com/Versent/saml2aws/releases/download/v@version@/saml2aws_@version@_linux_amd64.tar.gz"

    If you want to add a condition on architecture(linux, windows, x86, 64/32 bits):
    "https://github.com/docker/compose/releases/download/v@version@/docker-compose-$(uname -s | tr "[:upper:]" "[:lower:]")-$(uname -m)"
    "https://github.com/docker/docker-credential-helpers/releases/download/v@version@/docker-credential-wincred-v@[email protected]$(dpkg --print-architecture).exe"
    "https://github.com/Blacksmoke16/oq/releases/download/v@version@/oq-v@version@-$(uname -s)-$(uname -m)"

  COMMAND EXAMPLES:

    Download docker-compose latest version
    upgradeGithubRelease /usr/local/bin/docker-compose \
      "https://github.com/docker/compose/releases/download/v@version@/docker-compose-$(uname -s | tr "[:upper:]" "[:lower:]")-$(uname -m)"

    Download oq specific version
    upgradeGithubRelease /usr/local/bin/oq --exact-version 1.3.4 \
      "https://github.com/Blacksmoke16/oq/releases/download/v@version@/oq-v@version@-$(uname -s)-$(uname -m)"

    Download oq specific version correctly retrieving the oq version and not the jq one
    upgradeGithubRelease /usr/local/bin/oq --exact-version 1.3.4 --version-arg '-V | grep oq:' \
      "https://github.com/Blacksmoke16/oq/releases/download/v@version@/oq-v@version@-$(uname -s)-$(uname -m)"


VERSION: 3.0

AUTHOR: [François Chastanet](https://github.com/fchastanet)

SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/Git/upgradeGithubRelease/upgradeGithubRelease-binary.yaml

LICENSE: MIT License
Copyright (c) 2020-now François Chastanet
Or, if you want, you can alternatively use the GitHub discussion Q&A for feedback and questions.