A self-contained program that packages and deploys files and allows scripts to run on local and remote nodes via SSH
.NETFramework v4.5.2+ Download
- Download the
deploy.exe
latest version - Move the file
deploy.exe
to the installation folder - Run
deploy.exe --install
- Clone this repository
- Open a console on the repository root
- Run
package.cmd
- The program will be located at the
target
folder
deploy.exe --init
creates a new configuration filedeploy.exe --version
displays the product versiondeploy.exe --help
displays the available commandsdeploy.exe --install
installs the command to the%Path%
deploy.exe {path-to-config-file}
runs the deployment:- The
.json
extension will be included if not specified - If no path is used, the program searches for a file named
deploy.json
in the current working directory - See Path properties for common properties
- The
The configuration file extension must be .json
. All the paths in the configuration
file have common properties (see Path properties). The env
property is set as an
environment variable for local (%deploy_env%
) and remote ($deploy_env
) events.
{
"hostname": "", // the SSH hostname (domain.com) or ip (192.168.0.1) [required]
"port": 22, // the SSH port [default: 22]
"username": "", // the SSH username [required]
"privatekey": "", // the path to the SSH private key [required]
"env": "", // the environment name (local, virtualbox, prod, ...)
"sourcepath": "", // the file or folder to be packaged on the local node [required]
"uploadpath": "/tmp", // the temporary folder for unpackaging on the remote node [required]
"cleanuponexit": true, // remove temporary files and folders on exit [default: true]
"localshell": { // events run on local shell (e.g. command.cmd, script.ps1, program.exe)
"beforepackage": "", // run before packaging
"afterpackage": "", // run after packaging
"beforeupload": "", // run before upload
"afterupload": "" // run after packaging
},
"remoteshell": { // events run on remote shell (e.g. script.sh, program)
"beforepackage": "", // run before packaging
"afterpackage": "", // run after packaging
"beforeupload": "", // run before upload
"afterupload": "" // run after packaging
}
}
- The paths can be absolute or relative to the configuration file path
- Environment variables (
%UserProfile%
,%Temp%
, ...) in the path are replaced - If the path starts with
~
, the tilde will be replaced with%UserProfile%