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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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