JSPM

  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q77782F
  • License MIT

A simple CLI to manage multi-server deployment

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wukong-deploy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    wukong-deploy

    English | 简体中文

    A lightweight CLI tool for remote server deployment based on Node.js.

    Installation

    npm install -g wukong-deploy

    Usage

    Initialize Configuration

    wukong-deploy init

    This will generate a sample .env and config/config.mjs file in your current working directory.

    Deploy

    wukong-deploy deploy

    You will be prompted to select a target server interactively.

    Or specify the server key directly:

    wukong-deploy deploy [serverKey]
    • [serverKey] is the key defined in your configuration file (e.g., test, prod).

    Example:

    wukong-deploy deploy test

    Configuration Example

    config/config.mjs:

    export default {
      showCommandLog: true,
      servers: {
        test: {
          name: 'Test Server',
          host: '192.168.0.123',
          username: 'root',
          passwordEnv: 'SERVER_53_PASSWORD',
          commands: ['cd /your/project', 'git pull', 'npm run build'],
          finishMsg: '🎉 生产服务器部署完成'
        },
        prod: {
          name: 'Production Server',
          host: 'your.prod.ip',
          username: 'ubuntu',
          privateKey: '~/.ssh/id_rsa',
          commands: [
            'cd /home/ubuntu/app',
            'git pull origin main',
            'pm2 restart app'
          ],
          finishMsg: '✅ 构建完成'
        }
      }
    }

    Environment Variable Example (.env)

    SERVER_53_PASSWORD=your_password_here

    License

    MIT