Skip to content

Installation

benjboyer edited this page Feb 6, 2021 · 26 revisions

Prerequisites

JDK 11 or higher Groovy 3.0.7 or higher (mostly installed/updated automatically)

Pre-generated packages

All available here: https://github.com/peasoupio/inv/releases. Here is an example of how to extract: tar -xvf inv-#.tar.gz

Executables are located at ${extract_location}/bin. Confirmed supported OS'es:

  1. Windows 7 and up
  2. Linux
  3. Unix (Freebsd)
  4. MacOS

Maven

<dependency>
    <groupId>io.peasoup</groupId>
    <artifactId>inv</artifactId>
    <version>0.7-beta-SNAPSHOT</version>
</dependency>

(NOTE : Snapshots need to be downloaded from this repository: https://oss.sonatype.org/content/repositories/snapshots/)

Choco (Windows package installer)

choco install inv --pre 

Take a look at: https://chocolatey.org/packages/inv

Docker

Dockerhub page: https://hub.docker.com/repository/docker/peasoupio/inv

This how you would call Inv using Docker:

Dockerfile
FROM peasoupio/inv:0.6-beta-SNAPSHOT
ENV INV_HOME /invfiles

COPY ./my-inv-script-file /invfiles/
COPY ./my-inv-script-file2 /invfiles/

ENTRYPOINT ["inv", "run", *"]

NOTE: The Inv docker image exposes the same options as the pre-generated packages

Using INV

Concepts

Visit here for a complete and simple example on how to use INV using Groovy.

CLI commands and options

These are the available options:

Inv.

Usage:
 inv [-dxs] <command> [<args>...]

Options:
  -h --help    Show this screen.  
  -d --debug   Debug out. Excellent for troubleshooting.  
  -x --system  Print system troubleshooting messages.  
  -s --secure  Enable the secure mode for script files.  

The subcommands are:
  run          Load and execute INV files.
  syntax       Check the syntax of an INV or REPO file.
  repo-create  Create a REPO folder.
  repo-get     Get a REPO folder.
  repo-run     Run a REPO folder.
  repo-test    Test a REPO folder.
  composer     Start Composer dashboard
  init-run     Start Composer dashboard from an REPO file
  init-create  Create an empty Git init repository.
  promote      Promote a run.txt as the new base.
  delta        Generate delta between two run files.
  graph        Generate a graph representation.

Environment variables:
  INV_HOME     Defines the working directory.
               By default it uses the current folder.
run command
Load and execute INV files.

Usage:
  inv [-dsx] run [--exclude <exclude>] <include>...

Options:
  -e, --exclude=exclude
               Indicates the files to exclude.
               Exclusion is predominant over inclusion
               It is Ant-compatible 
               (p.e *.groovy, ./**/*.groovy, ...)

Arguments:
  <include>    Indicates the files to include.
               It is Ant-compatible 
               (p.e *.groovy, ./**/*.groovy, ...)
               It is also expandable using a space-separator
               (p.e myfile1.groovy myfile2.groovy)
syntax command
Check the syntax of an INV or REPO file.

Usage:
  inv [-dsx] syntax [--exclude <exclude>] <include>...

Options:
  -e, --exclude=exclude
               Indicates the files to exclude.
               Exclusion is predominant over inclusion
               It is Ant-compatible 
               (p.e *.groovy, ./**/*.groovy, ...)

Arguments:
  <include>    Indicates the files to include.
               It is Ant-compatible 
               (p.e *.groovy, ./**/*.groovy, ...)
               It is also expandable using a space-separator
               (p.e myfile1.groovy myfile2.groovy)
repo-get command
Get a REPO file from an URL address.

Usage:
  inv [-dsx] repo-get [--run] [--create-parameters] <repoUrl>

Options:
  -r, --run
               Run the REPO file after getting it.
  -c, --create-parameters
               Create a parameter file of a REPO file.

Arguments:
  <repoUrl>    The REPO remote file location.
repo-run command
Execute a REPO file from.

Usage:
  inv [-dsx] repo-run [--list] <repoFile>

Options:
  -l, --list 
               Use a list of repo to run.

Arguments:
  <repoFile>   The REPO file location.
repo-test command
Test a REPO folder at the current INV_HOME location.

Usage:
  inv [-dsx] repo-test 
repo-create command
Create a new ".inv" REPO folder at the current INV_HOME location.

Usage:
  inv [-dsx] repo-create
composer command
Start Composer at the current INV_HOME location.

Usage:
  inv [-dsx] composer [-p <port>]

Options:
  -p, --port=port
               Sets the listening port
    
Environment variables:
  INV_SSL_KEYSTORE  Sets the SSL keystore location
  INV_SSL_PASSWORD  Sets the SSL keystore password
init-run command
Start Composer using an INIT file.

Usage:
  inv [-dsx] init-run <repoFile>

Options:
  -p, --port=port
               Sets the listening port

Arguments:
  <repoFile>   The REPO file location.
    
Environment variables:
  INV_SSL_KEYSTORE  Sets the SSL keystore location
  INV_SSL_PASSWORD  Sets the SSL keystore password
init-create command
Create a new INIT folder named <repoName> at the current INV_HOME location.

Usage:
  inv [-dsx] init-create <repoName>

Arguments:
  <repoName>   The REPO name.
promote command
Promote a run.txt as the new base.

Usage:
  inv [-dsx] promote [<runIndex>]

Arguments:
  <runIndex>   The run index whose promotion will be granted.
               Runs are located inside INV_HOME/.runs/ 
               By default, it uses the latest successful run
delta command
Generate delta between two run files.

Usage:
  inv [-dsx] delta <base> <other>

Arguments:
  <base>       Base file location
  <other>      Other file location
graph command
Generate delta between two run files.

Usage:
  inv [-dsx] graph <base>

Arguments:
  <base>       Base file location

Inside a Java application

This how you would call Inv from inside a Java/Groovy application:

MyJavaClass.java
import io.peasoup.inv.run.InvExecutor;

import java.io.File;

public class MyJavaClass {

    void start() {
        InvExecutor executor = new InvExecutor();
        executor.addClass(new File("my-inv-script-file"));

        // Does the actual processing
        executor.execute();
    }
}