0.0.5-test-pr-facf705ebfe35efc899d397a4d8f881b1dc17612 • Published 5 years ago

@balena/transformer-runtime v0.0.5-test-pr-facf705ebfe35efc899d397a4d8f881b1dc17612

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
5 years ago

ProductOS Transformer Runtime Package

This package serves to be an un-opinionated runner of transformers. This package allows you to obtain the minimal functionality to run a transformer by providing input, artifact, and output targets.

Example Usage

Run a transformer of image example-image:latest:

import TransformerRuntime from '../src';
import * as yaml from 'js-yaml';
import * as fs from 'fs';
import * as path from 'path';
import { Contract } from '@balena/jellyfish-types/build/core';
import testTransformer from './test-transformer';

const runtime = new TransformerRuntime();

const img = 'example-image';
const version = 'latest';

const artifactDir = path.join(__dirname, 'artifactDir');
const workingDir = path.join(__dirname, 'in');
const transformerImage = `${img}:${version}`;
const outputDir = path.join(__dirname, 'out');
const runPrivileged = true;
const content = fs
	.readFileSync(path.join(artifactDir, '/balena.yml'))
	.toString();
const contract = yaml.load(content) as Contract;

async function main() {
	const result = await runtime.runTransformer(
		artifactDir,
		contract,
		testTransformer,
		transformerImage,
		workingDir,
		outputDir,
		runPrivileged,
	);
}

main()
1.5.2

4 years ago

1.5.1

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.5.0

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago