auto-ftp is an automation tool for deploying via FTP. It allows you to describe the files that need to be deployed, where to deploy it to, and what credentials to use in a configuration file so it works the same every time.
npm install -g auto-ftp
auto-ftp --init
Generates the ftp_config.json file. Fill in the host, username, and password fields...
{
"ftpConfig" : {
"host": "",
"username": "",
"password": ""
},
"ftpBatches": [{
"localRoot": "",
"remoteRoot": "",
"match": ["**", "!package.json", "!node_modules"]
}]
}auto-ftp to start transfer.
auto-ftp -h for help.
To copy all files in the upload apart from package.json and node_modules to the "/website-root" directory...
{
"ftpConfig" : {
"host": "yourhost.com",
"username": "yourusername",
"password": "yourpassword"
},
"ftpBatches": [{
"localRoot": "",
"remoteRoot": "/website-root",
"match": ["**", "!package.json", "node_modules"]
}]
}To copy all files from the "web" directory and the "config.json" file from the "/config/production" to the root ftp directory...
{
"ftpConfig" : {
"host": "yourhost.com",
"username": "yourusername",
"password": "yourpassword"
},
"ftpBatches": [{
"localRoot": "web",
"remoteRoot": "",
"match": ["**"]
},
{
"localRoot": "",
"remoteRoot": "/website-root",
"match": ["config/production/config.json"]
}]
}