3.2.4 • Published 2 months ago

ngx-ssh-deploy v3.2.4

Weekly downloads
40
License
MIT
Repository
bitbucket
Last release
2 months ago

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/\/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/"
        }
    }
}
3.2.4

2 months ago

3.2.2

2 months ago

3.2.1

2 months ago

3.2.0

2 months ago

3.2.3

2 months ago

3.0.3

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.2

1 year ago

2.7.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.3.0

2 years ago

2.5.0

2 years ago

2.4.0

2 years ago

2.3.1

2 years ago

2.7.0

2 years ago

2.5.2

2 years ago

2.6.0

2 years ago

2.5.1

2 years ago

2.7.1

2 years ago

2.2.0

2 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago