How to use @faasjs/deployer - 2 common examples

To help you get started, we’ve selected a few @faasjs/deployer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github faasjs / faasjs / packages / cli / src / commands / deploy.ts View on Github external
if (lstatSync(path).isFile()) {
      list.push(path);
    } else {
      if (!path.endsWith('/')) {
        path += '/';
      }
      list.push(...[...new Set(globSync(path + '*.func.ts').concat(globSync(path + '**/*.func.ts')))]);
    }
  }

  if (list.length < 1) throw Error('Not found files.');

  // 单个云函数文件直接部署
  if (list.length === 1) {
    const deployer = new Deployer({
      root: process.env.FaasRoot!,
      filename: list[0]
    });
    await deployer.deploy();
  } else {
    console.log(`[${process.env.FaasEnv}] 是否要发布以下云函数?`);
    console.log(list);
    console.log('');
    const readline = createInterface({
      input: process.stdin,
      output: process.stdout
    });
    readline.question('输入 y 确认:', async function (res) {
      readline.close();

      if (res !== 'y') {
github faasjs / faasjs / packages / cli / src / commands / deploy.ts View on Github external
readline.question('输入 y 确认:', async function (res) {
      readline.close();

      if (res !== 'y') {
        console.error('停止发布');
        return;
      } else {
        for (const file of list) {
          const deployer = new Deployer({
            root: process.env.FaasRoot!,
            filename: file
          });
          await deployer.deploy();
        }
      }
    });
  }

@faasjs/deployer

A tool to deploy a FaasJS function.

MIT
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis

Popular @faasjs/deployer functions

Similar packages