fis3-deploy-http-push-own
v1.0.0
Published
fis3 deploy http-push plugin
Downloads
5
Maintainers
Readme
fis3 http Deploying plug -in
FIS The default deployment plug -in provides local deployment and remote UPLOAD deployment capabilities.
Install
Both the overall installation or local installation can be.
npm install -g fis3-deploy-http-push-own
Instructions
You can also use a unified deploy plug -in configuration method
fis.match('*.js', {
deploy: fis.plugin('http-push-own', {
//If the receiver is configured, the FIS will post the file one by one to the receiving end
receiver: 'http://www.example.com:8080/receiver.php',
//This parameter will be sent along with the post request
to: '/home/fis/www',
// Additional parameters, the back end is obtained through $ _post ['xx']
// If the data contains the to this key, then the to parameter above will cover the to in the data
data: {
subOnly: false, //If it is set to TRUE, it supports the transmission subdirectory
token : 'abcdefghijk',
user : 'maxming',
uid : 1
}
})
})
Alternative usage
For example: Token input is required during deployment
learn by analogy
const crypto = require('crypto');
const readlineSync = require('readline-sync');
fis.match('**', {
deploy: [
function (options, modified, total, next) {
var token = readlineSync.question('\r\nPlease enter the authorization 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] = {
//If the receiver is configured, the FIS will post the file one by one to the receiving end
receiver: 'http://127.0.0.1/receiver.php?debug=false',
// receiver: 'http://127.0.0.1/receiver.php',
//This parameter will be sent along with the post request
to: '/home/fis/www',
// to: '/Users/fis/www',
// Additional parameters, the back end is obtained through $ _post ['xx']
data: {
token: fis.get('project.token')
}
};
require('fis3-deploy-http-push-own').apply(this, arguments);
}
]
});