1.0.3 • Published 2 years ago

web-deploy-cd v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

前端代码自动发布服务器/代码备份

  • 功能说明: 多环境发布,自动备份

使用说明

  • 安装
yarn add web-deploy-cd -D
  • 新建deploy文件 index.js
const deploy = require('web-deploy-cd')
// 服务器参数配置 (可多个)
const config = [
  {
    id: 'test',    // 发布环境
    name: '测试环境',
    publisherName: "", // 发布者名称
    locationPath: 'dist/dist.zip', // 本地文件路径
    path: '/home/frontend/h5/dist.zip', // 服务器代码路径
    host: '196.168.10.1',
    port: 22,
    username: '',
    password: ''
  }
]

deploy(config)
  • package.json
"scripts":{
    "deploy": "node ./deploy/index.js"
}
  • 运行
 yarn deploy

压缩

  • webpack配置
yarn add filemanager-webpack-plugin -D
const outputDir = "dist"
const FileManagerWebpackPlugin = require('filemanager-webpack-plugin');
{ 
   plugins:[
    new FileManagerWebpackPlugin({
        events: {
          onEnd: {
            // delete: [`./${outputDir}/${outputDir}.zip`],
            archive: [
              { source: `./${outputDir}`, destination: `./${outputDir}/${outputDir}.zip` }
            ]
          }
        }
      })
    ]
}
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago