deploy.js
// transfers local project to the remote server
transfers local project to the remote server
transfers local project to the remote server
function transferProjectToRemote(failed, successful) {
    return ssh.putDirectory(
        '../' + app_folder_name,
        `/home/ubuntu/${app_folder_name}-temp`,
        {
            recursive: true,
            concurrency: 1,
            validate: function (itemPath) {
                const baseName = path.basename(itemPath);
                return (
                    baseName.substr(0, 1) !== '.'
                    && baseName !== 'node_modules' 
                    && baseName !== 'config'
                ); 
            },
            tick: function (localPath, remotePath, error) {
                if (error) {
                    failed.push(localPath);
                    console.log('failed.push: ' + localPath);
                } else {
                    successful.push(localPath);
                    console.log('successful.push: ' + localPath);
                }
            }
        }
    );
}
function transferProjectToRemote ( failed , successful ) { return ssh . putDirectory ( '../' + app_folder_name , ` ${ app_folder_name } ` , { recursive : true , concurrency : 1 , validate : function ( itemPath ) { const baseName = path . basename ( itemPath ) ; return ( baseName . substr ( 0 , 1 ) !== '.' && baseName !== 'node_modules' && baseName !== 'config' ) ; } , tick : function ( localPath , remotePath , error ) { if ( error ) { failed . push ( localPath ) ; console . log ( 'failed.push: ' + localPath ) ; } else { successful . push ( localPath ) ; console . log ( 'successful.push: ' + localPath ) ; } } } ) ; }
transfers local project to the remote server
transfers local project to the remote server
// do not allow dot files // do not allow node_modules