0.0.26 • Published 7 years ago
rwt-migrate v0.0.26
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
0.0.26
7 years ago
0.0.25
7 years ago
0.0.24
7 years ago
0.0.23
7 years ago
0.0.22
7 years ago
0.0.21
7 years ago
0.0.20
7 years ago
0.0.19
7 years ago
0.0.18
7 years ago
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago