0.1.0 • Published 7 years ago
suce v0.1.0
suce
A tool to deploy node application to servers.
# global
npm install suce -g
# local
npm install suce --save-dev.gitignore
# ignore suce tmp directory
.sucecommand line
suce <command> [args]sync: upload local files to server, with executing shell scripts on server
suce sync <entry>project config
Defined in suce.config.js of project root directory.
module.exports = ({entry, cmd}) => config;src
desc: gulp srctype:string/arraysince:v0.1.0example:
'**/*'
['entry1/**/*', 'entry2/**/*']server
desc: options for gulp-sshtype:mapsince:v0.1.0example:
{
ignoreErrors: true,
{
host: 'localhost',
username: 'senntyou',
password: 'senntyou',
},
}remotePath
desc: remote server pathtype:stringsince:v0.1.0
pre
desc: shell scripts to execute before uploading filestype:string/arraysince:v0.1.0example:
['cd ~/suce', 'ls -lh --color=never']Pre shell scripts will generate a pre.log file in .suce directory of project root directory.
post
desc: shell scripts to execute after uploading filestype:string/arraysince:v0.1.0example:
['cd ~/suce/project', 'npm install', 'npm restart']Post shell scripts will generate a post.log file in .suce directory of project root directory.
multiple server environments
If you need to support multiple server environments(test, gray, prod), you can do like this:
suce sync entry --env test
suce sync entry --env gray
suce sync entry --env prodWith minimist.
# suce.config.js
const argv = require('minimist')(process.argv.slice(2));
const configs = {
test: { ... },
gray: { ... },
prod: { ... },
};
module.exports = configs[argv.env];