@mondaycom/apps-cli
Version:
A cli tool to manage apps (and monday-code projects) in monday.com
36 lines (35 loc) • 1.32 kB
JavaScript
import { Listr } from 'listr2';
import { buildAssetToDeployTask, buildClientZip, deployClientZip, handleDeploymentTask, prepareEnvironmentTask, uploadAssetTask, } from '../push-service.js';
export const getTasksForClientSide = (appVersionId, directoryPath, region) => {
const ctx = { appVersionId, directoryPath, region };
return new Listr([
{ title: 'Build asset to deploy', task: buildClientZip },
{
title: 'Deploying client side files',
task: deployClientZip,
},
], {
ctx,
});
};
export const getTasksForServerSide = (appVersionId, directoryPath, region) => {
const ctx = { appVersionId, directoryPath, region };
return new Listr([
{ title: 'Build asset to deploy', task: buildAssetToDeployTask },
{
title: 'Preparing environment',
task: prepareEnvironmentTask,
enabled: ctx => Boolean(ctx.showPrepareEnvironmentTask),
},
{
title: 'Uploading built asset',
task: uploadAssetTask,
enabled: ctx => Boolean(ctx.showUploadAssetTask),
},
{
title: 'Deployment in progress',
task: handleDeploymentTask,
enabled: ctx => Boolean(ctx.showHandleDeploymentTask),
},
], { ctx });
};