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

rwt-migrate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rwt-migrate

Migrate webtasks between deployments

  • 0.0.26
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Migrate Webtasks between deployments

Usage

const { Token, TokenStore, Deployment, WebtaskAnalyzer } = require('webtask-migrate');

// inputs
const tenantTokenString = process.env.TENANT_TOKEN;
const fromDeploymentUrl = process.env.FROM_DEPLOYMENT_URL;
const toDeploymentUrl = process.env.TO_DEPLOYMENT_URL;
const tenantName = process.env.TENANT_NAME;
const webtaskName = process.env.WEBTASK_NAME;

// Setup
const tokenStore = new TokenStore();
tokenStore.addToken(new Token(tenantTokenString));

const fromDeployment = new Deployment(tokenStore, fromDeploymentUrl);
const toDeployment = new Deployment(tokenStore, toDeploymentUrl);

const webtaskAnalyzer = new WebtaskAnalyzer(fromDeployment, tenantName);

// Download the webtask
const downloadOptions = {
  includeCron: true,
  includeStorage: true,
  includeSecrets: true
};
const webtask = await fromDeployment.downloadWebtask(tenantName, webtaskName, downloadOptions);

// Run analysis on the webtask
const analysis = await webtaskAnalyzer.analyze(webtaskName, webtask);

// Update the webtask with any missing dependencies
webtask.addDependencies(analysis.dependencies);

// Ensure that all module dependencies are provisioned on the new deployment
await toDeployment.provisionModules(webtask.getDependencies(), tenantName);

// Upload the webtask to the new deployment
await toDeployment.uploadWebtask(tenantName, webtaskName, webtask);

// Write out an warnings detected during the analysis
console.log(analysis.warnings)

See the samples folder for examples that provide batch processing of webtasks migration

FAQs

Package last updated on 20 Apr 2018

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