fuse

boxfuseFuse

Fuses a Payload together with the Components it requires into an Image.

Usage: gradle boxfuseFuse -Dboxfuse.payload=payload

When run as part of a build, the project artifact will automatically be used as a payload.

> gradle boxfuseFuse -Dboxfuse.payload=hello-1.0.war

Fusing Image for hello-1.0.war ...
Image fused in 00:07.351s (48147 K) -> axelfontaine/hello:1.0

Class name

com.boxfuse.client.gradle.task.FuseTask

Supported Payload formats:

  • Executable jar file
  • War file
  • Play dist zip
  • Node.js tgz
  • ELF64 binary
  • Revel tar.gz

Properties

Plugin Parameter Gradle/System property Default Description
user boxfuse.user Required - Your Boxfuse Client user. Also configurable via the BOXFUSE_USER environment variable
secret boxfuse.secret Required - Your Boxfuse Client secret. Also configurable via the BOXFUSE_SECRET environment variable
payload boxfuse.payload The project artifact The Payload to use. Can be either a file, a directory or a URL.
payloadPort boxfuse.payload.port autodetected The main port on which the payload starts (usually http or https)
payloadPath boxfuse.payload.path / The path where the payload starts
cmd boxfuse.cmd first executable file in image

Generic Linux x64 apps only

The command to start the app including relative path and all necessary arguments
components boxfuse.components.NAME latest version Pins the component with this name onto this version.
Example: -components.tomcat=8.0.9
debug boxfuse.debug false Start the Payload in debug mode when an Instance launches
debugWait boxfuse.debug.wait false

JVM apps only

Whether the JVM should wait for the remote debugger to connect (Only applicable when debug mode is active)
envvars boxfuse.envvars.NAME Fuses this environment variable into the image and make it available at runtime
Example: boxfuse.envvars.JDBC_URL=jdbc:mydburl
healthcheck boxfuse.healthcheck true Check whether to payload started correctly
healthcheckPort boxfuse.healthcheck.port autodetected The port to check whether to payload started correctly
healthcheckPath boxfuse.healthcheck.path / The path to check whether to payload started correctly
healthcheckTimeout boxfuse.healthcheck.timeout 300 The number of seconds to wait for the Payload to come up
jvmArgs boxfuse.jvm.args

JVM apps only

Extra arguments to pass to the JVM
jvmJmx boxfuse.jvm.jmx false

JVM apps only

Enable the JMX remote management and profiling interface for the JVM
jvmMainClass boxfuse.jvm.main.class autodetected

JVM apps only

Main class to invoke on JVM startup
jvmMainArgs boxfuse.jvm.main.args

JVM apps only

Arguments to pass to the main class
live boxfuse.live false Enable live reloading of changes in dev for super fast round-trips. Note that images with live reloading cannot be pushed to the Boxfuse Vault.
newrelicLicensekey boxfuse.newrelic.licensekey Installs and configures the New Relic agents to monitor your instance.
ports boxfuse.ports.NAME http=80

Exposes the port of the app with this name using this definition. Example: boxfuse.ports.jmx=8001

Supported formats:

80TCP port 80, universally accessible
80/tcpTCP port 80, universally accessible
80/udpUDP port 80, universally accessible
80/tcp:@TCP port 80 only accessible from your own IP
80/udp:@/20UDP port 80 only accessible from the IPs in the CIDR /20 block of your own IP
80/udp:1.2.3.4UDP port 80 only accessible from 1.2.3.4
80/tcp:1.2.3.4/31TCP port 80 only accessible from the IPs in the CIDR /31 block of 1.2.3.4
tmp boxfuse.tmp 1 The amount of temp space to allocate to /tmp in GB
vault boxfuse.vault false Immediately upload the new Image to the Boxfuse Vault

Sample Configuration

boxfuse {
    user='1234567890abcdef1234567890abcdef12345678'
    secret='ABCDEFGHIJKL1234567abcdefghijklmnopqrstu'
    payload='hello-1.0.war'
    payloadPort='https'
    payloadPath='/app'
    cmd='-cmd=bin/myapp -with -my args'
    components=[
        'openjdk':'8.25.40',
        'tomcat':'8.0.20'
    ]
    debug=true
    debugWait=false
    envvars=[
        'JDBC_URL':'jdbc:mydburl',
        'MY_OTHER_VAR':'abc'
    ]
    healthcheck=true
    healthcheckPort='https'
    healthcheckPath='/health'
    healthcheckTimeout=120
    jvmArgs='-DmycustomProp=abc'
    jvmJmx=true
    jvmMainClass='com.mycorp.MyApp'
    jvmMainArgs='-abc -def'
    live=true
    newrelicLicensekey='0123456789abcdef0123456789abcdef012345'
    ports=[
        'https':443,
        'http':80
    ]
    tmp=16
    vault=false
}

Dynamically defined properties

After you execute run, Boxfuse will automatically define the following Gradle properties

Gradle property Description
boxfuse.image The image that was used to launch the instances

ls