1.3.4 • Published 2 years ago

az-upload v1.3.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

az-upload

A tool for quickly packaging and uploading your code to the server

Installation

npm install az-upload --save -dev

or

yarn add az-upload --dev

Usage

Create file "upload.config.js/upload.config.json/.uploadrc" in the project root directory.

Add scripts like this:

// 'env' will be 'production'
"upload": "az-upload"

or

// 'env' will be 'stage'
"upload:stage": "az-upload stage"

configuration

"upload.config.js" example:

module.exports = {
  uploadDir: 'build',
  packingCMD: (env) => {
    if (env === 'production') return 'npm run build'
    return `npm run build:${env}`
  },
  confirm: ['production'],
  environment: {
    production: {
      ip: '',
      port: '',
      username: '',
      password: '',
      path: '',
      rmPath: '',
    },
    stage: {
      ip: '',
      port: '',
      username: '',
      password: '',
      path: '',
      rmPath: '',
    },
  },
}

uploadDir

String

Not required. Default: 'dist'

The files you want to upload. Generally, it is the directory of the packaged code.

packingCMD

Function/Object/String

Not required

The script use to packaging your code. 'env' is from your script.

Example:

module.exports = {
  // Function, default
  packingCMD: (env) => {
    if (env === 'production') return 'npm run build'
    return `npm run build:${env}`
  },
  // Object
  packingCMD: {
    production: 'npm run build',
    stage: 'npm run build:stage',
  },
  // String
  packingCMD: 'npm run build',
}

confirm

Boolean/Array/Function

Not required

Does command execution require confirmation? 'env' is from your script.

Example:

module.exports = {
  // Array, default
  confirm: ['production'],
  // Boolean
  confirm: true,
  // Function
  confirm: (env) => {
    if (env === 'production') return true
    return false
  },
}

environment

Object

Required

'environmentenv' will be used for connecting the server. 'env' is from your script.

ip: ip of server

port: port of server

username: username of server

password: password of server

path: the path to upload your code

rmPath: the path cleaned before uploading

1.2.0

2 years ago

1.2.6

2 years ago

1.3.4

2 years ago

1.2.5

2 years ago

1.1.6

2 years ago

1.3.3

2 years ago

1.2.4

2 years ago

1.3.2

2 years ago

1.2.3

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago