0.1.0-alpha.7 • Published 1 year ago

vite-plugin-better-deploy v0.1.0-alpha.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

中文

使用SSH自动部署到服务器

项目采用 chalkora实现与vite一致的控制台风格

目前仅支持vite项目,计划后续支持所有node项目类型,支持的配置项如下:

安装

npm install vite-plugin-better-deploy -D

或者

pnpm install vite-plugin-better-deploy -D

或者

yarn add vite-plugin-better-deploy -D

使用示例

vite.config.ts

import AutoDeploy from 'vite-plugin-better-deploy'

export default {
  plugins: [
    AutoDeploy({
      host: '127.0.0.1',
      username: 'root',
      password: '123456',
      remotePath: '/www/wwwroot/example',
      previewPath: 'https://github.com/strange-qwq/auto_deploy',
    })
  ]
}

配置项

export type PluginConfig = ClientConfig & {
    /**
     * 是否需要确认(默认为 true)
     */
    needInquire?: boolean
    /**
     * 部署前是否删除整个远程路径,true则删除整个文件夹,false则只删除与打包文件名称重复的文件(默认为 false)
     */
    removeRemote?: boolean
    /**
     * 部署后是否删除本地文件(默认为 false)
     */
    removeLocal?: boolean
    /**
     * 服务器上传的完整路径
     */
    remotePath: string
    /**
     * 服务器预览地址,用于部署后提示访问
     */
    previewPath?: string
}

export interface ClientConfig {
    /**
     * SSH地址
     */
    host: string
    /**
     * SSH端口(默认为 22)
     */
    port?: number
    /**
     * SSH用户名
     */
    username: string
    /**
     * SSH密码
     */
    password: string
}

English

Automatically deploy to servers using SSH

The project uses chalk and ora to implement a console style consistent with vite.

At present, only the vite project is supported, and plans to support all node project types in the future.

Install

npm install vite-plugin-better-deploy -D

or

pnpm install vite-plugin-better-deploy -D

or

yarn add vite-plugin-better-deploy -D

Example

vite.config.ts

import AutoDeploy from 'vite-plugin-better-deploy'

export default {
    plugins: [
        AutoDeploy({
            host: '127.0.0.1',
            username: 'root',
            password: '123456',
            remotePath: '/www/wwwroot/example',
            previewPath: 'https://github.com/strange-qwq/auto_deploy',
        })
    ]
}

Configuration

export type PluginConfig = ClientConfig & {
    /**
     * Do you need to confirm (default to true)
     */
    needInquire?: boolean
    /**
     * Do you want to delete the entire remote path before deployment? If true, delete the entire folder. If false, only delete files with duplicate packaging file names (default to false)
     */
    removeRemote?: boolean
    /**
     * Delete local files after deployment (default to false)
     */
    removeLocal?: boolean
    /**
     * The complete path uploaded by the server
     */
    remotePath: string
    /**
     * Server preview address, used to prompt access after deployment
     */
    previewPath?: string
}

export interface ClientConfig {
    /**
     * SSH address
     */
    host: string
    /**
     * SSH port (default to 22)
     */
    port?: number
    /**
     * SSH username
     */
    username: string
    /**
     * SSH password
     */
    password: string
}

Special Thanks

0.1.0-alpha.5

1 year ago

0.1.0-alpha.4

1 year ago

0.1.0-alpha.7

1 year ago

0.1.0-alpha.6

1 year ago

0.1.0-alpha.1

1 year ago

0.1.0-alpha.3

1 year ago

0.1.0-alpha.2

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago