github.com/konsorten/ktn-build-info@v1.0.11/HELP.md (about)

     1  # Commandline help text: 
     2  ``` 
     3  Incorrect Usage. flag: help requested
     4  
     5  NAME:
     6     ktn-build-info.exe - Build Information Tool
     7  
     8      This tool creates build version information files
     9      based on the available information and writes
    10      them to different file formats.
    11      
    12      If available, it will read from existing files:
    13        * version-info.yml
    14        * package.json (NPM)
    15  
    16      It looks for the version-info.yml file in the specified
    17      and parent directories.
    18  
    19  USAGE:
    20     ktn-build-info.exe [global options] [arguments...]
    21  
    22  VERSION:
    23     1.0.11.24
    24  
    25  AUTHOR:
    26     marvin + konsorten GmbH
    27  
    28  GLOBAL OPTIONS:
    29     --directory value, -C value  The directory in which to run. Using the current as default. (default: ".")
    30     --debug, -d                  Enable debug output.
    31     --version, -v                print the version
    32  
    33  INPUTS:
    34    version-info              Read project and version information from an existing version-info.yml file in the current or parent directories.
    35      depth:{levels}          Limit depth of directories to scan. Set to 0 for current directory, only. Default is 10.
    36    directory-name            Use the working directory's name as project name.
    37    build-host                Use the current machine's name and time as build host and timestamp.
    38    consul-build-id           Retrieves a build number based on the build revision. Use this for non-numeric revisions, like Git.
    39      url:{consulurl}         The connection URL to consul, e.g. http://consul:8500/dc1 or http://:token@consul:8500/dc1.
    40      root:{key}              The base KV path for the project, e.g. builds/myproject.
    41    npm                       Read project and version information from an existing package.json file in the current directory.
    42      name:false              Ignore the project name.
    43      desc:false              Ignore the project description.
    44      license:false           Ignore the project license information.
    45      version:false           Ignore the project version number.
    46      author:false            Ignore the project author information.
    47    konsorten                 Use marvin + konsorten default author information.
    48    teamcity                  Read project name, version, and revision information from TeamCity environment variables.
    49      build:false             Ignore the build number.
    50      rev:false               Ignore the revision number.
    51      name:false              Ignore the project name.
    52    gitlab-ci                 Read project name and revision information from GitLab CI environment variables.
    53      rev:false               Ignore the revision number.
    54      name:false              Ignore the project name.
    55    git                       Read revision information from current directory's Git repository.
    56    env-vars                  Read build information from environment variables.
    57      name:{envVarName}       Read the project name from the specified environment variable {envVarName}. Ignored if missing or empty.
    58      desc:{envVarName}       Read the project description from the specified environment variable {envVarName}. Ignored if missing or empty.
    59      rev:{envVarName}        Read the build revision from the specified environment variable {envVarName}. Ignored if missing or empty.
    60      build:{envVarName}      Read the build ID from the specified environment variable {envVarName}. Ignored if missing or empty.
    61      buildHost:{envVarName}  Read the build host name from the specified environment variable {envVarName}. Ignored if missing or empty.
    62    limit-revision            Limits the length of the revision string.
    63      length:{int}            The number of characters to limit the revision string, e.g. 7 for Git short revision.
    64  
    65  OUTPUTS:
    66    template              Renders a template file and writes the result into a file dropping the last extension, e.g. myfile.c.template becomes myfile.c. Takes the relative file path as parameter.
    67      file:{path}         Path to the template file.
    68      mode:{filemode}     File mode to use for the file (Linux and macOS). Typical values are 644 for a regular file and 755 for an executable file.
    69    update-npm            Updates an existing NPM package.json file in the current directory.
    70    update-json           Updates an existing JSON document.
    71      file:{path}         Path to the JSON file.
    72      indent:{chars}      Characters to use for indent, like four space characters.
    73      !{path}:{value}     Set the value at {path} to {value}. All template file fields are supported. Strings have to be quoted, e.g. '"{$.Author$}"' or '{$.Author | asQuoted$}'. Missing objects are created automatically.
    74      !{path}:$null$      Sets the value at {path} to null.
    75      !{path}:$delete$    Deletes the value at {path}.
    76    update-xml            Updates an existing XML document.
    77      file:{path}         Path to the XML file.
    78      indent:{chars}      Characters to use for indent, like four space characters.
    79      !{xpath}:{value}    Set the value at {xpath} to {value}. The target element/attribute must exist. All template file fields are supported.
    80      !{xpath}:$create$   Creates a new element or attribute from {xpath}. The parent element must exist.
    81      !{xpath}:$ensure$   If missing, creates a new element or attribute from {xpath}. The parent element must exist.
    82      !{xpath}:$delete$   Deletes the value at {xpath}.
    83    update-regex          Updates an existing text document.
    84      file:{path}         Path to the text file.
    85      posix:true          Restricts the regular expression to POSIX ERE (egrep) syntax.
    86      !{regex}:{replace}  Replaces all matches of {regex} with {replace}. All template file fields are supported.
    87    go-syso               Writes the version information to be embedded into an Go executable (version_info.syso). Supported on Windows, only.
    88    teamcity              Writes the version number back to TeamCity.
    89  
    90  TEMPLATE FILE FIELDS:
    91    {$.Author$}         The name of the author/manufacturer, e.g. the company name.
    92    {$.BuildDate$}      The current timestamp as Go time.Time object, usage: {$.BuildDate.Year$}
    93    {$.BuildDateISO$}   The current ISO timestamp, example: 2018-02-27T17:28:58Z
    94    {$.BuildDateUnix$}  The current epoch unix timestamp, example: 1519752538
    95    {$.BuildHost$}      The name of the current machine, example: wks005
    96    {$.Description$}    The description of the project.
    97    {$.Email$}          The support e-mail address for the product.
    98    {$.License$}        The license which applies to the project.
    99    {$.Name$}           The name/ID of the project.
   100    {$.Revision$}       The source code revision, example: b862de
   101    {$.SemVer$}         The semantic version number as A.B.C-build+D-rev.XXXXX with four parts, example: 1.2.3-build+3-rev.b862de
   102    {$.Version$}        The version number as A.B.C.D with four parts, example: 1.2.3.4
   103    {$.VersionParts$}   The version number as array with four elements, usage: {$index .VersionParts 0$} for major version number.
   104    {$.VersionTitle$}   The version number as descriptive text, example: 1.2.3 (build: 4, rev:b862de)
   105    {$.Website$}        The website of the author or the product.
   106  
   107  TEMPLATE FUNCTIONS:
   108    asBool      Convert the value to a boolean value. Use this to convert strings or numbers to true/false.
   109    asInt       Convert the value to an integer number. Use this to convert enumerations to their respective numeric value.
   110    asQuoted    Convert the value to a quoted string. Use this to convert values to a quoted string. Will escape existing quotes to '\"'.
   111    asString    Convert the value to a string. Use this to convert complex objects to their string representation.
   112    encodeHtml  Encode the value to be HTML compatible, e.g. '&' becomes '"'.
   113    encodeUrl   Encode the value to be URL compatible, e.g. '&' becomes '%26'.
   114    encodeXml   Encode the value to be XML compatible, e.g. '&' becomes '"'.
   115    envVar      Reads the specified value from an environment variable, e.g. {$envVar "TEMP"$}.
   116  
   117    See for more details: https://golang.org/pkg/text/template/
   118  
   119  ```