Better Deployment with Node.js
#Envoy Fast, simple deployment of static sites.
var envoy=require'envoy'ftpOptions =username: 'Fluffy'password: 'McChubbers'host: 'ftp.cheeseburger.com'simpleWebsite ="index.html": '<h1>Welcome, Humans!</h1>'iferrconsoleerr"Uh-oh: " + err;elseconsole.log"Website Deployed!";console.log"Deployment log:";forvar i=0 ii=loglength; i<ii; i++console.loglogi;;// Deploying a local folder to FTPenvoydeployFolder'./my-website-folder' 'ftp' ftpOptions afterDeploy;// Deploying a collection of files to FTPenvoydeployCollectionsimpleWebsite 'ftp' ftpOptions afterDeploy;
You can perform lower level calls with the adapters directly.
var client = './lib/adapters/ftp'opts = username:'donkey' password:'kong';clientbeforeoptsclientput'some_file.txt' 'Some Data'clientafterconsole.log"Done!";;;;
All adapters support three operations
Certain adapters like FTP will support more operations unique to their operation
Take a look at the tests for more.
.envoyfile in the remote directory to speed up future deploys. Make sure your FTP server is configured to show dotfiles.
You need a
tests/secrets.json file to run integration tests on your own server. See
tests/secrets.example.json for an example.