fis.match('*.js', {
deploy: fis.plugin('http-push', {
receiver: 'http://www.example.com:8080/receiver.php',
to: '/home/fis/www',
data: {
token : 'abcdefghijk',
user : 'maxming',
uid : 1
}
})
})
const crypto = require('crypto');
const readlineSync = require('readline-sync');
fis.match('**', {
deploy: [
function (options, modified, total, next) {
var token = readlineSync.question('\r\n请输入授权token : ', {
hideEchoBack: true
});
if (!token) {
return false;
}
var md5 = crypto.createHash('md5');
fis.set('project.token', md5.update(token).digest('hex'));
next();
},
function () {
arguments[0] = {
receiver: 'http://127.0.0.1/receiver.php?debug=false',
to: '/home/fis/www',
data: {
token: fis.get('project.token')
}
};
require('fis3-deploy-http-push').apply(this, arguments);
}
]
});