@kexin88/deploy-cli

1.3.0-pre-3 • Public • Published

Welcome to deploy-cli 👋

Version Documentation Maintenance License: ISC

“Deploy CLI” is a one-click deployment CLI tool that allows users to deploy programs to servers with just one command based on their configurations. This tool can help users quickly deploy programs and improve efficiency. You can describe the features and advantages of this tool in the introduction.

🏠 Homepage | 中文文档

Prerequisites

This parameter is applicable only to the yarn method. Other methods are not applicable

  • node >=16.0.0
  • npm >=7.0.0

Install

Yarn(Recommended)

yarn global add @kexin88/deploy-cli

Npm(Deprecated)

Deprecated: npm uninstall -g does not trigger the preuninstall event and therefore cannot delete the global binary file.

Script Install

Linux && MacOS

curl -fsSL https://github.com/kexin8/auto-deploy/releases/download/install/install.sh | sh

China mainland users can use the following command to speed up the download

curl -fsSL https://ghproxy.com/https://github.com/kexin8/auto-deploy/releases/download/install/install.sh | sh -s https://ghproxy.com

Windows (PowerShell)

# Optional: Needed to run a remote script the first time
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://github.com/kexin8/auto-deploy/releases/download/install/install.ps1 | iex
# if you can't access github, you can use proxy
irm https://github.com/kexin8/auto-deploy/releases/download/install/install.ps1 -Proxy '<host>:<ip>' | iex

China mainland users can use the following command to speed up the download

# Optional: Needed to run a remote script the first time
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://ghproxy.com/https://github.com/kexin8/auto-deploy/releases/download/install/install_ZH-CN.ps1 | iex

Usage

deploy --version

Commands

Init Config

Run deploy init command to initialize the configuration file. The configuration file is located in the current directory. The default name is dyconfig.json. If you want to all the configuration file to be named dyconfig.json, you can add -a parameter. Detailed configuration file description can be found in Configuration. Example:

deploy init
# or
deploy init -a

Deploy Program

Run deploy command to deploy program to server. The configuration file is located in the current directory. The default name is dyconfig.json. Example:

deploy
# or
deploy /path/to/dyconfig.json

More

More commands can be found by running deploy --help or deploy -h command.

$ deploy -h
NAME:
   deploy - this is a simple cli app that automates deploy

USAGE:
   deploy [\path\to\config.json]

VERSION:
   v1.3.0-pre

DESCRIPTION:
   This is a simple cli app that automates deploy.
   e.g. This is a common way to perform deploy, according to dyconfig.json in the current path
     deploy
   This is manually specifying the configuration file
     deploy \path\to\config.json

COMMANDS:
   init     
   upgrade  upgrade deploy
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

Configuration

The configuration file is a json file, which can be generated by running deploy init command.

Field Type Required Description
address string true The address of the server to be deployed.
username string true The username of the server to be deployed.
password string true The password of the server to be deployed.
srcFile string true The path of the file to be deployed. allow multiple files to be separated by commas.
workDir string false The path of the directory to be deployed.
changeWorkDir boolean false Whether to change the working directory.
preCmd string[] false The commands to be executed before deployment.
postCmd string[] false The commands to be executed after deployment.

Example:

{
  "address": "127.0.0.1:22",
  "username": "username",
  "password": "password",
  "srcFile": "file1,file2,...",
  "workDir": "/path/to/workDir",
  "changeWorkDir": true,
  "preCmd": [
    "echo 'preCmds'"
  ],
  "postCmd": [
    "echo 'postCmds'"
  ]
}

Author

👤 kexin8

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2023 kexin8.
This project is ISC licensed.


This README was generated with ❤️ by readme-md-generator

Package Sidebar

Install

npm i @kexin88/deploy-cli

Weekly Downloads

14

Version

1.3.0-pre-3

License

ISC

Unpacked Size

47.1 kB

Total Files

6

Last publish

Collaborators

  • kexin8