Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deploy websites over FTP with one command line

License

NotificationsYou must be signed in to change notification settings

Konnng/ftp-deploy

 
 

Repository files navigation

Syncs a local folder with a remote folder over ftp.

After the initial sync only differences are synced, making deployments super fast!

Latest Stable VersionNPM Downloads


How to Run

Option 1 - Run via command line

  • Install the npm package usingnpm install @samkirkland/ftp-deploy --only=dev

  • Run via command lineftp-deploy --server ftp.samkirkland.com --username test@samkirkland.com --password \"CrazyUniquePassword&%123\"

  • Or you can add a script to make deployments easier

  • Add a new key to yourpackage.json file underscripts section. See example below.

  • You can run the script using the following commandnpm run deploy (run this in the folder that has thepackage.json file)

Example ofpackage.json:

{"scripts": {"deploy":"ftp-deploy --server ftp.samkirkland.com --username test@samkirkland.com --password\"CrazyUniquePassword&%123\"",  },}

Option 2 - Run programmatically

  • Install the npm package usingnpm install @samkirkland/ftp-deploy --only=dev
  • Import the code and use it in your code

Example ofmyCustomDeployment.js:

import{deploy,excludeDefaults}from"@samkirkland/ftp-deploy";asyncfunctiondeployMyCode(){console.log("🚚 Deploy started");awaitdeploy({server:"ftp.samkirkland.com",username:"username@samkirkland.com",password:`CrazyUniquePassword&%123`,// note: I'm using backticks here ` so I don't have to escape quotesexclude:[...excludeDefaults,"dontDeployThisFolder/**"]// excludeDefaults will exclude .git files and node_modules});console.log("🚀 Deploy done!");}deployMyCode();

Automatically Deploying

If you use github as source control you can automatically re-deploy your site on every git commit.Read more


Settings

To list all commands with examples simply runftp-deploy without any options.

Key NameRequiredExampleDefault ValueDescription
--serverYesftp.samkirkland.comDeployment destination server
--usernameYesusername@samkirkland.comftp username
--passwordYesCrazyUniquePassword&%123ftp password, be sure to escape quotes and spaces
--portNo99021Server port to connect to (read your web hosts docs)
--protocolNoftpsftpftp: provides no encryption,ftps: full encryption newest standard (aka "explicit" ftps),ftps-legacy: full encryption legacy standard (aka "implicit" ftps)
--local-dirNo./myFolderToPublish/./Path to upload to on the server, must end with trailing slash/
--server-dirNoftp.samkirkland.com/./Folder to upload from, must end with trailing slash/
--state-nameNofolder/.sync-state.json.ftp-deploy-sync-state.jsonftp-deploy uses this file to track what's been deployed already, so only differences can be published. If you don't like the name or location you can customize it
--dry-runNotruefalsePrints which modifications will be made with current config options, but doesn't actually make any changes
--dangerous-clean-slateNotruefalseDeletes ALL contents of server-dir, even items marked as--exclude argument
--excludeNonuclearLaunchCodes.txt**/.git***/.git*/****/node_modules/**An array of glob patterns, these files will not be included in the publish/delete process
--log-levelNoinfoinfominimal: only important info,standard: important info and basic file changes,verbose: print everything the script is doing
--securityNostrictloosestrict: Reject any connection which is not authorized with the list of supplied CAs.loose: Allow connection even when the domain is not in certificate
--timeoutNo6000030000Timeout in milliseconds for FTP operations

About

Deploy websites over FTP with one command line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript97.4%
  • JavaScript2.6%

[8]ページ先頭

©2009-2025 Movatter.jp