Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openfn/deploy

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfn/deploy

Deploy projects to Lightning instances

  • 0.2.3
  • npm
  • Socket score

Version published
Weekly downloads
686
increased by80.53%
Maintainers
4
Weekly downloads
 
Created
Source

Deploy

A module providing facilities to interactively deploy projects and workflows to instances of OpenFn Lightning.

Given a project configuration file, a config file and optionally a state file, this module will:

  • Create or update a project.
  • Query for differences between local and remote state and confirm whether to deploy.

Basic Usage

import { readFile } from 'node:fs/promises';
import deploy from '@openfn/deploy';

const extraOptions = {};

await deploy(
  {
    project: await readFile('project.json', 'utf8'),
    config: await readFile('config.json', 'utf8'),
    state: await readFile('state.json', 'utf8'),
  },
  extraOptions
);

See the test folder for more usage examples.

The runtime provides no CLI. Use packages/cli (devtools) for this.

Configuration

The deployment endpoints are configurable.

In all cases, you will need to provide an API token in order to identify yourself to the API.

The ability to set which endpoint you want to deploy to is useful for testing environments, but also for deploying to a local instance of OpenFn Lightning.

State Files

State files are used to keep a reference between the keys used in the project files and the IDs of the remote objects.

In addition the file is used to keep track of the last deployed version of the project. This allows the deployment to be checked for differences between the local and remote versions.

Building

To build a js package into dist/, run:

$ pnpm build

To watch and re-build whenever the js changes, run

$ pnpm build:watch

Note: The watch throws an error on first run but seems to work.

You can test or watch tests with:

$ pnpm test
$ pnpm test:watch

FAQs

Package last updated on 01 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc