Pyro-gateway - a TypeScript library for starting Ignition Docker containers

pyro-gateway

pyro-gateway provides an API for starting Ignition Docker containers from within JavaScript. This library is intended for use in testing environments where you need a short-lived, programmatically configured, ephemeral gateway.

Usage

Start a new Gateway

import { IgnitionContainer } from '@mussonindustrial/pyro-gateway'

const gateway = await new IgnitionContainer('8.1.33')
    .withModules(['perspective'])
    .withGatewayName('My New Gateway')
    .start()

Start a Gateway from a Backup

import { IgnitionContainer } from '@mussonindustrial/pyro-gateway'

const gateway = await new IgnitionContainer('8.1.33')
    .withGatewayBackup('/path/to/gateway.gwbk')
    .start()

Setting Gateway Properties

Gateway properties can be set before startup through the various .with~ methods.

// Current available setter methods
.withEdition(edition: GatewayEdition)
.withHTTPPort(port: number)
.withHTTPSPort(port: number)
.withModules(modules: ModuleIdentifier[])
.withGatewayName(name: string)
.withGatewayBackup(path: string)

The eventual goal is to provide a complete set of setter methods.
In the meantime, if you wish the directly set environment or runtime variables, they can be accessed through gateway.env and gateway.runtime respectively.

See the GitHub page for full details.

5 Likes