auth0/webtask-migrate

Name: webtask-migrate

Owner: Auth0

Description: A JS library for migrating webtasks between deployments

Created: 2018-04-10 17:50:19.0

Updated: 2018-05-15 20:41:20.0

Pushed: 2018-05-15 20:41:19.0

Homepage: null

Size: 58

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Migrate Webtasks between deployments

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

nputs
t tenantTokenString = process.env.TOKEN;
t fromDeploymentUrl = process.env.FROM_DEPLOYMENT_URL;
t toDeploymentUrl = process.env.TO_DEPLOYMENT_URL;
t tenantName = process.env.TENANT;
t webtaskName = process.env.WEBTASK_NAME;

etup
t tokenStore = new TokenStore();
nStore.addToken(new Token(tenantTokenString, tenantName));

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

t webtaskAnalyzer = new WebtaskAnalyzer(fromDeployment, tenantName);

ownload the webtask
t downloadOptions = {
cludeCron: true,
cludeStorage: true,
cludeSecrets: true

t webtask = await fromDeployment.downloadWebtask(tenantName, webtaskName, downloadOptions);

un analysis on the webtask
t analysis = await webtaskAnalyzer.analyze(webtaskName, webtask);

pdate the webtask with any missing dependencies
ask.addDependencies(analysis.dependencies);

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

pload the webtask to the new deployment
t toDeployment.uploadWebtask(tenantName, webtaskName, webtask);

rite out an warnings detected during the analysis
ole.log(analysis.warnings)

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.