ngx-ssh-deploy

3.2.4 • Public • Published

ngx-ssh-deploy

version npm

Installation

npm i -D ngx-ssh-deploy

or globally install the package

npm i -g ngx-ssh-deploy

Or using ng add

ng add ngx-ssh-deploy

Usage

Initialize configuration

ngx-ssh-deploy init

Or init with host, user and pem file and deployment path

ngx-ssh-deploy init ec2-user@ec2-127-0-0-1.example.compute.amazonaws.com/sub -K ./certs/example.com/example.pem -P /home/ec2-user/angular-app

Or using ng add

ng add ngx-ssh-deploy --endpoint ec2-user@ec2-127-0-0-1.example.compute.amazonaws.com/sub --pem-file ./certs/example.com/example.pem --ssh-path /home/ec2-user/angular-app --project my-angular-app

Deploy the app

ngx-ssh-deploy deploy

Generate web server configuration

for Apache

ngx-ssh-deploy config apache

or nginx

ngx-ssh-deploy config nginx

CLI

ngx-ssh-deploy [command]

Commands:
  init [endpoint]                               Init ngx-ssh-deploy
  config <serverName> [environment]             Generate server configuration
  deploy [environment]                          Deploy Angular to server using SSH
  build [environment]                           Build project and run post build command(s) if any. Useful to run in pipeline, e.g., docker
  stats [environment]                           Run webpack-bundle-analyzer for specific deploy environment
  update-target-login [environment]             Generate shell commands to update target SSH login authorized_keys
Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Example Configuration (ngx-ssh-deploy.json)

{
  "$schema": "./node_modules/ngx-ssh-deploy/ngx-ssh-deploy.schema.json",
  "environments": {
    "angular-app": {
      "directDeploy": false,
      "endpoint": {
        "host": "ec2-127-0-0-1.example.compute.amazonaws.com",
        "port": 22,
        "user": "ec2-user",
        "pemFile": "./certs/example.com/example.pem"
      },
      "ssh": {
        "path": "/home/ec2-user/angular-app"
      },
      "nodeOptions": {
        "max_old_space_size": 8096
      },
      "postBuildCommand": "npx cpx {project.sourceRoot}{sep}pwa{sep}manifest.webmanifest {dirDist}{sep}",
      "projectConfiguration": "production",
      "targetUrl": "https://example.com/"
    }
  },
  "defaultEnvironment": "angular-app"
}

or angular.json projects/<project>/architect ng deploy

{
    "deploy": {
        "builder": "ngx-ssh-deploy:deploy",
        "options": {
            "directDeploy": false,
            "endpoint": {
                "host": "ec2-127-0-0-1.example.compute.amazonaws.com",
                "port": 22,
                "user": "ec2-user",
                "pemFile": "./certs/example.com/example.pem"
            },
            "ssh": {
                "path": "/home/ec2-user/angular-app"
            },
            "postBuildCommand": "npx cpx {project.sourceRoot}{sep}pwa{sep}manifest.webmanifest {dirDist}{sep}",
            "projectConfiguration": "production",
            "targetUrl": "https://example.com/"
        }
    }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.2.48latest

Version History

VersionDownloads (Last 7 Days)Published
3.2.48
3.2.33
3.1.13
3.1.03
3.0.33
3.0.23
3.0.13
3.0.04
2.7.23
2.7.13
2.6.03
2.5.23
2.5.14
2.4.03
2.3.13
2.3.03
2.2.03
2.1.05
2.0.13
2.0.03
1.5.04
1.4.03
1.3.24
1.3.13
1.3.03
1.2.04
1.1.04
1.0.33
1.0.23
1.0.03

Package Sidebar

Install

npm i ngx-ssh-deploy

Weekly Downloads

103

Version

3.2.4

License

MIT

Unpacked Size

267 kB

Total Files

116

Last publish

Collaborators

  • dkhang97