click2deploy

0.0.25 • Public • Published

click2deploy

Elegant CLI application to Deploy

Version Downloads/week License

Install

$ npm install click2deploy

Usage


$ click2deploy COMMAND

$ click2deploy (-v|--version|version)

$ click2deploy --help [COMMAND]

Commands

click2deploy deploy

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.

How It Works

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).

Pre-requisites

  1. It's better to do ssh-copy-id from the HOST system to the REMOTE system
  2. Add Host system ssh key to your git account
  3. 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.

Usage

  $ click2deploy deploy

Options

  -c, --config=config  Absolute Path of the Config File

Configuration

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." ]

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)",

RequireSSHKey

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)

branch

Git Branch

verboseSSHLevel:

SSH verbosity level to use when connecting to remote servers.0(none) 1(-v),2(-vv),3(-vvv)"

Environment

Environment of deployment(Can be anything)

Key

Path of the pem file (Will be asked if RequireSSHKey is true)

Servers

user@host:port

BashFilePath

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

CONFIG FILE

  {
    "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": "uat@uat.server.com"
    }
}

_See code: [src/commands/deploy.js]

click2deploy help [COMMAND]

display help for click2deploy

USAGE
  $ click2deploy help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

Package Sidebar

Install

npm i click2deploy

Weekly Downloads

1

Version

0.0.25

License

MIT

Unpacked Size

26.3 kB

Total Files

12

Last publish

Collaborators

  • vasu2652