Coder Social home page Coder Social logo

front-deploy-2's Introduction

前端发布工具

一键发布内容到服务器\OSS\COS

配置概览

const deploy = require('./index');

deploy({
  dir: '', // 部署内容所在目录
  rule: { // 部署的规则
    prefix: '', // 路径前缀
    transfer: {  // 转移部分文件,例如将index.html部署到另外一个位置
      match: 'index.html',
      remotePath: 'index.html',
    },
    // ignore 忽略规则
    ignoreRule: '',
  },
  config: {
    deployType: 'oss', // 部署类型 oss | cos | server
    // 阿里云配置
    alioss: {
      // 桶名称
      bucket: '',
      // 区域
      region: '',
      accessKeyId: '',
      accessKeySecret: '',
    },
    // 腾讯云配置 大写开头
    cos: {
      // 桶名称
      Bucket: '',
      // 区域
      Region: '',
      SecretId: '',
      SecretKey: '',
    },
    // 服务器配置
    server: {
      // 主机地址
      host: '',
      // 端口
      port: 22,
      // 账号
      username: 'root',
      // 密码或密钥
      password: '', // 或者为 privateKey
    },
  },
});

参数说明

dir: 部署内容的目录

rule: 部署规则

属性 值类型 默认值 说明
prefix String - 默认前缀路径
transfer Array/Object null 转移文件部署路径
ignoreRule String - 忽略文件规则,ignore通用规则,例外:忽略目录后,不会扫描该目录下的指定路径

transfer配置说明

属性 值类型 默认值 说明
match String - 匹配的路径名称,相对全名称
remotePath String - 被转移到的目标路径,绝对全名称
type String 'copy' 转移类型:move | copy move转移后原来的列表不会存在此文件的任务
deployType String - 可以指定单个文件部署类型,默认原部署类型

config: 部署的上传服务配置

属性 值类型 默认值 说明
deployType String 'server' 部署类型,可选值:oss | cos | server
alioss Object null 阿里云OSS的配置,参考配置概览
cos Object null 腾讯云COS的配置,参考配置概览
server Object null 服务器的配置,参考配置概览

front-deploy-2's People

Contributors

ossso avatar

Forkers

ecogit-stage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.