Giter Site home page Giter Site logo

deploy-ftp's Introduction

Nodejs FTP deploy

Build and deploy a nodejs application (such as React, Angular, Vue ecc...).

From version 1.1.2, using DSDEPLOY_FTP_PREDEPLOY variable, you can deploy anything, even not a site.

Version License: MIT Downloads GitHub issues Dependencies

Configuration

Create a .env.local file in your project directory with following variables:

Environment variable Type Description
DSDEPLOY_FTP_USER string Required. FTP username
DSDEPLOY_FTP_HOST string Required. FTP host
DSDEPLOY_FTP_PASSWORD string FTP password (prompted if none given)
DSDEPLOY_FTP_PORT integer FTP port (default 21)
DSDEPLOY_FTP_REMOTE_DIR string Remote directory name where file will be placed, will use the project directory name if not provided
DSDEPLOY_FTP_LOCAL_DIR string Local directory to upload, will look for the dist or build directory if not provided
DSDEPLOY_FTP_DELETE_REMOTE integer Set to 0 or 1 to delete remote files before upload (default 0)
DSDEPLOY_FTP_FORCE_PASSIVE_MODE integer Set to 0 or 1 to use passive mode (default 1)
DSDEPLOY_FTP_USE_SFTP integer Set to 0 or 1 to use SFTP (default 0)
DSDEPLOY_FTP_PREDEPLOY string Execute commands before deploy, you can define multiple commands to execute by separating them with a semicolon. If you don't want to execute any commands, set the variable to none (default: npm run build).

Example of a .env.local with default/example values

DSDEPLOY_FTP_USER=yourftpusername
DSDEPLOY_FTP_HOST=host.example.xyz
DSDEPLOY_FTP_PASSWORD=yourpassword
DSDEPLOY_FTP_PORT=21
DSDEPLOY_FTP_REMOTE_DIR=remote-directory
DSDEPLOY_FTP_LOCAL_DIR=dist
DSDEPLOY_FTP_DELETE_REMOTE=0
DSDEPLOY_FTP_FORCE_PASSIVE_MODE=1
DSDEPLOY_FTP_USE_SFTP=0
DSDEPLOY_FTP_PREDEPLOY="npm run build"

Usage

Use this command to deploy to your FTP server:

npx @dsabre/deploy-ftp

Optionally, you can pass the name of the environment variables file as a command parameter:

npx @dsabre/deploy-ftp .env

or with any name you want:

npx @dsabre/deploy-ftp myEnvFile.txt

Contributing

For contributions, issues and feature requests please check issues page.

Authors

Support me

Buy Me a Coffee

License

MIT

deploy-ftp's People

Contributors

dsabre avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.