The problems that exist now

Every time you’re done packing, you have to open FileZilla and drag and drop the code before you can upload the code, which is immediately done with an automated script

publish-sftp

Github portal uploads local files to the server with a single command

Publish-sftp -c // DoneCopy the code

security

The project team has been running for more than half a year, and there has been no unact

implementation

Based on an ssh2 – SFTP – client

Quick learning

install

    sudo npm i publish-sftp -g
    sudo npm link publish-sftp
Copy the code

tips

You need to provide an sftp.json file in the current directory

{
    "localPath": "./dist"."remotePath": "/export/App/xxx"."protectedRemotePath": "/export/App/xxx"."connect": {
        "host": "xxx.xxx.xxx.xx"."port": 22."username": "root"."password": "123456"}}Copy the code

example

Copy all files in localPath to remotePath/ XJX /test. If the -c parameter is empty, the file is copied to remotePath. If the remote directory does not exist, the file is created first

copy

Copy all files from localPath to remotePath, or ${remotePath}/${XXX} if XXX has a value

publish-sftp -c xxx
Copy the code

remove

${remotePath}/${XXX}; ${remotePath}/${XXX}; Generally the same value as remotePath!

publish-sftp -r xxx
Copy the code

Thank you for reading