# git-release-helper

> A script that helps pushing code by git, building bundles and releasing version on remote server.

Latest version **1.0.4** (published 2019-12-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install git-release-helper
pnpm add git-release-helper
yarn add git-release-helper
bun add git-release-helper
```

Provides the command `grh`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-12-23 |
| First published | 2019-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 53.4 KB |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| Author | Scrooge6792 |
| Maintainers | scrooge6792 |

## Links

- npm: https://www.npmjs.com/package/git-release-helper
- npm.io page: https://npm.io/package/git-release-helper

## Dependencies (8)

- [clui](https://npm.io/package/clui.md) ^0.3.6
- [ssh2](https://npm.io/package/ssh2.md) ^0.8.6
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [clear](https://npm.io/package/clear.md) ^0.1.0
- [inquirer](https://npm.io/package/inquirer.md) ^7.0.0
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [simple-git](https://npm.io/package/simple-git.md) ^1.126.0
- [configstore](https://npm.io/package/configstore.md) ^5.0.0

## Recent versions

- 1.0.4 (latest) — 2019-12-23
- 1.0.3 — 2019-11-28
- 1.0.2 — 2019-11-28
- 1.0.1 — 2019-11-27
- 1.0.0 — 2019-11-27

## README

# git-release-helper

这是一个协助开发人员提交代码的脚本。

## 功能

- 自动执行一系列的git命令
- 自动构建代码
- 自动登录ssh服务器并发布版本

## 背景

摆脱繁琐的手动发版步骤，我们可以利用脚本去帮助处理这些事情

> 如果有更为复杂详细的步骤，或者想要有更优的方案，可以采用持续集成（CI）

## 安装

> 推荐安装到全局
```sh
$ npm install -g git-release-helper
```

## 使用说明

###1. 创建配置文件生成`grhconfig.json`文件，然后修改内容

```sh
$ cd myProject && grh init
```

```json
{
  "SSHConfigPath": "D:\\myProject\\ssh.json",
  "outputPath": "/build"
}
```

其中构建步骤会执行`npm run build`，`outputPath`对应webpack的output路径。

`ssh.json`请单独存在项目外，内容如下

```json
{
  "connectionOptions":  {
    "host": "127.0.0.1",
    "username": "admin",
    "password": "admin"
  },
  "commands": {
    "myProject": "cd /srv/app/myProject\ngit pull origin prod\nexit\n"
  }
}
```

###2. 在`.gitignore`上添加`grhconfig.json`

###3. 愉快地推代码

```sh
$ cd myProject && grh
```

![示例图](https://github.com/Scrooge6792/git-release-helper/blob/dev/image/sketch.png)

## 维护者

[@Scrooge6792](https://github.com/Scrooge6792).

## 如何贡献

非常欢迎你的加入！ [提一个Issue](https://github.com/Scrooge6792/git-release-helper/issues/new) 或者提交一个 Pull Request。

---
_Source: https://npm.io/package/git-release-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
