An automated tool to deploy untracked files to servers (such as images) through the use of SFTP.
The Node-package-manager (npm) is the recommended way to install deployme. To install via npm, run npm install deployme -g. The -g parameter specifies that the package should be installed globally, which is recommended for nearly every use case.
In addition, there are a few other varieties to installing via npm:
# install through this GitHub repository
npm install panchr/deployme -g
# Install directly through GitHub
npm install https://github.com/panchr/node-deployme.git -g
To install via git, run these commands in your terminal of choice:
git clone https://github.com/panchr/node-deployme.git
Now, you can directly access the CLI (Command Line Interface) by using ./bin/cli.
Again, I highly recommend using npm instead.
The CLI tool uses the default configuration file, .deploy-config. To generate a standard configuration file, run deployme init.
This will generate the configuration file in the current directory.
Note: deployme will search for a .deploy-config file in any of the parent directories of the current working directory. So, it is possible to run the tool in any subdirectory of a project.
The configuration options are stored as standard JSON.
The host name of the server
Port to connect to the server with
The username to connect with
The password of the above user
An object of local configuration
The local root of the files to sync
The local directories to sync
The local files to sync (not supported yet)
An object of remote configuration
The remote root to sync to
For example, here is a sample configuration file:
"directories": ["images", "icons"],
"files": ["myfavicon.ico", "secure.js"]
deployme comes with a few useful commands:
This is the initialization script. To use it, run deployme init. It will walk you through the setup of the main configuration file, .deploy-config.
Reset is very similar to init. In fact, it provides the same functionality but allows you to override previous options. It is invoked via deployme reset.
To get a list of commands and what they do, use deployme help.
To see what the files that need to be synced, run deployme diff.
Finally, deployme sync will calculate the required changes to be synced and then upload the appropriate files to the remote server.
deployme local provides a series of subcommands that allows you to configure the local settings of the syncer:
Set the local root path to the file path
deployme local root /static
Add a local path to be synced
deployme local add /test
Add matching local paths to be synced
deployme local add *.css
Remove a local path from being synced
deployme local remove mystyle.css
Remove matching local paths from being synced
deployme local remove test/*
deployme remote only provides one command so far, but more will be added soon. Each subcommand allows you to configure the remote settings of the syncer:
Set the remote root path to "filepath"
deployme remote root /var/www/static