0.3.12 • Published 7 years ago

ssh-deployer v0.3.12

Weekly downloads
59
License
MIT
Repository
github
Last release
7 years ago

SSH Deployer

SSH-Deployer is designed to run commands and copy files/directories over SSH using a preconfigured JSON file.

Usage: ssh-deployer [options]

Options:
  -f, --file  JSON Configuration File       [required]

Getting Started

Install 'ssh-deployer' globally by running the following command.

npm install -g ssh-deployer

Create your JSON file. In this case it would be....

{
    "machine": {
        "host": "192.168.1.100",
        "username": "your-ssh-username",
        "password": "your-ssh-password"
    },
    "directories": [
        {
            "source": "./dist",
            "destination": "/uploads"
        }
    ],
    "files": [
        {
            "source": "./web.config",
            "destination": "/opt/app/web.config"
        }
    ],
    "commands": [
        "sudo apt-get update",
        "sudo ufw status"
    ]
}

Saved as 'sample.json'

To execute this file, run the following command.

ssh-deployer --file "sample.json"

Adding parameters to JSON file.

In the previous example the mahcine host, username and password was hard-coded.

Parameters can be added by using the '$' sign. For example.

{
    "machine": {
        "host": "$host",
        "username": "$username",
        "password": "$password"
    },
    "directories": [
        {
            "source": "./dist",
            "destination": "/uploads"
        }
    ],
    "files": [
        {
            "source": "./web.config",
            "destination": "/opt/$appname/web.config"
        }
    ],
    "commands": [
        "sudo apt-get update",
        "sudo ufw status"
    ]
}

To execute this file with parameters, run the following command.

ssh-deployer --file "sample.json" --host 192.168.1.100 --username hello --password world --appname myapp

Notes

The order of execution is as follow:

  • Copies directories in the given order.
  • Copies files in the given order.
  • Executes commands in the given order.
0.3.12

7 years ago

0.3.11

7 years ago

0.3.10

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.17

7 years ago

0.2.16

7 years ago

0.2.15

7 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago