Elegant CLI application to Deploy
$ npm install click2deploy
$ click2deploy COMMAND
$ click2deploy (-v|--version|version)
$ click2deploy --help [COMMAND]
When executed, will prompt you a bunch of questions which all are mandatory to complete the deployment of the application.
Alternatively, you can provide the absolute path of the existing config file
in JSON format exactly in
the below format.
click2deploy internally uses the shipit module and acts as a wrapper to simplify the deployment of any application with very less configuration.
click2deploy pulls the latest code from provided git URL and copies into the remote directory. After copying it executes a bash file which is present in the remote server. You can maintain the bash file to build the application, install dependencies, start the process(PM2).
- It's better to do ssh-copy-id from the HOST system to the REMOTE system
- Add Host system ssh key to your git account
- It's better to have a bash file script in your repository and provide a relative path from the main working directory of your project.
$ click2deploy deploy
-c, --config=config Absolute Path of the Config File
Directory where the code will be deployed on remote servers.
Repository URL to clone, must be defined using https or git+ssh format.
[ "List of files excluded in copyFromRemote or copyToRemote methods." ]
Number of Releases Which you wish to maintain in the Server to Rollback if there is an error in current release deployment ",
Clone only the last commit of the repository(Type: Boolean, default true)",
Do you want to provide .pem file to access your remote server (Recommended to add the remote host into known hosts in your system by performing ssh-copy-id)
Git Branch
SSH verbosity level to use when connecting to remote servers.0(none) 1(-v),2(-vv),3(-vvv)"
Environment of deployment(Can be anything)
Path of the pem file (Will be asked if RequireSSHKey is true)
user@host:port
Path of bash script which will be executed afte copying the code to remote server. This can be used to 1.Build your application or Generate Executables 2.Install your dependencies 3. Start the process using pm2 etc.. Check How it works Section to understand
{
"default": {
"deployTo": "Directory where the code will be deployed on remote servers.",
"repositoryUrl": "Repository URL to clone, must be defined using https or git+ssh format.",
"ignores": [
"List of files excluded in copyFromRemote or copyToRemote methods."
],
"rsync": [
"--del"
],
"keepReleases": "Number of Releases Which you wish to maintain in the Server to Rollback if there is an error in current release deployment ",
"shallowClone": "Clone only the last commit of the repository(Type: Boolean, default true)",
"branch": "Git Branch",
"verboseSSHLevel": "SSH verbosity level to use when connecting to remote servers.0(none) 1(-v),2(-vv),3(-vvv)"
},
"uat": {
"branch": "master",
"Key": "Path to SSH key.",
"servers": "[email protected]"
}
}
_See code: [src/commands/deploy.js]
display help for click2deploy
USAGE
$ click2deploy help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI