A package simplify your update server routine job.
- Clean remote resource directory.
- Upload zip package into remote server.
- Unzip package.
Create a config file: us.config.js in your project root directory.
The content will look like this:
const config = {
server: {
host: '127.0.0.1',
port: 22, // default 22
username: 'test',
// It will store it in plain text.
// You have to make sure this security.
password: 'password',
},
upload: {
// Will find the package in this directory
localPath: './target/',
// Will find the first match file
fileRex: /^cc-image-news.*\.zip$/,
// This directory will be cleaned before upload package.
// You can input a relate path with remotePath.
// If you leave this empty, nothing will be cleaned
cleanPath: './resources/cc-image-news/',
// The package will put in this directory
remotePath: '/data/',
}
};
module.exports = config;
Now, you can use lc-update-server
command to refresh static files.
MIT. See LICENSE for more detail.
[x] 移除删除文件夹的行为,已经有解压缩覆盖行为了。