ossx-cli
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

ossx-cli

npm version npm downloads bundle License

指定文件夹上传至对象存储服务,可用于日常部署前端代码自动化脚本

rec.gif

支持平台

🌐 平台 📊 支持状态
阿里云 ✅ 已支持
腾讯云 ✅ 已支持
SSH ✅ 已支持
七牛云 ⏳ 计划支持
自定义 ✅ 已支持

上传支持错误日志查看,默认输出至node_modules/.ossx目录下

安装

pnpm add -D ossx-cli

使用

npx ossx

创建配置

项目根目录创建ossx.config.[ts|js|json]文件:

import { defineConfig } from 'ossx-cli'

export default defineConfig({
  provider: {
    name: 'aliyun-oss',
    // ...不同OSS剩余配置请查看types
  },
  // cwd: process.cwd(),
  // 本地要上传的目录,相对于cwd,只允许相对路径
  target: 'dist',
  // OSS目录,会将所有文件上传至该目录,可不填,但不要以/开头
  destination: 'archive',
  // 忽略上传的文件,支持glob
  ignoreFiles: ['*.zip']
})

配置示例

腾讯云

import { defineConfig } from 'ossx-cli'

export default defineConfig({
  provider: {
    name: 'tencent-cloud-cos',
    secretId: 'xxx',
    secretKey: 'xxx',
    bucket: 'bucket-xxx',
    region: 'ap-guangzhou',
  },
  target: 'dist',
  destination: 'www',
  maxLogfiles: 30
})

SSH

import { defineConfig } from 'ossx-cli'

export default defineConfig({
  provider: {
    name: 'ssh',
    host: '127.0.0.1',
    port: 22,
    username: 'ubuntu',
    privateKeyPath: './.ssh/key.pem'
  },
  target: 'dist',
  destination: '/opt/nginx/www',
  maxLogfiles: 30
})

License

MIT License © hackycy

Readme

Keywords

none

Package Sidebar

Install

npm i ossx-cli

Weekly Downloads

5

Version

0.1.5

License

MIT

Unpacked Size

37.7 kB

Total Files

11

Last publish

Collaborators

  • hackycy