Skip to content

Translate all .md instructions to English #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

## 0.5.x

## 新特性
- 针对文本增量更新进行优化,使用google `diff-match-patch` 算法计算差异
- react-native-code-push Android客户端适配,需要合并https://github.com/Microsoft/react-native-code-push/pull/1393, 才能正常使用文本增量更新功能。
- react-native-code-push iOS客户端适配 (需要合并https://github.com/Microsoft/react-native-code-push/pull/1399)
- react-native-code-push Windows客户端适配 (进行中)
## New Features
- Optimized for text incremental updates using Google's `diff-match-patch` algorithm
- react-native-code-push Android client adaptation, requires merging https://github.com/Microsoft/react-native-code-push/pull/1393 to use text incremental update feature
- react-native-code-push iOS client adaptation (requires merging https://github.com/Microsoft/react-native-code-push/pull/1399)
- react-native-code-push Windows client adaptation (in progress)

## fixbug
## Bug Fixes

- 修复统计数据激活数
- 修复灰度发布bug
- rollback后增加计算和最后一次增量更新版本
- Fixed activation count in statistics
- Fixed gray release bug
- Added calculation and last incremental update version after rollback

## 如何升级到该版本
## How to Upgrade to This Version

### 升级数据库
### Upgrade Database

`$ npm run upgrade`

Expand All @@ -27,41 +27,41 @@ or

## 0.4.x

### 新特性
### New Features

- targetBinaryVersion 支持正则匹配, `deployments_versions`新增字段`min_version`,`max_version`
- `*` 匹配所有版本
- `1.2.3` 匹配特定版本`1.2.3`
- `1.2`/`1.2.*` 匹配所有1.2补丁版本
- targetBinaryVersion supports regex matching, `deployments_versions` table adds `min_version`, `max_version` fields
- `*` matches all versions
- `1.2.3` matches specific version `1.2.3`
- `1.2`/`1.2.*` matches all 1.2 patch versions
- `>=1.2.3<1.3.7`
- `~1.2.3` 匹配`>=1.2.3<1.3.0`
- `^1.2.3` 匹配`>=1.2.3<2.0.0`
- 添加docker编排服务部署,更新文档
- `~1.2.3` matches `>=1.2.3<1.3.0`
- `^1.2.3` matches `>=1.2.3<2.0.0`
- Added docker orchestration service deployment, updated documentation
- Support Tencent cloud cos storageType

## 如何升级到该版本
## How to Upgrade to This Version

- 升级数据库
- Upgrade Database
`$ ./bin/db upgrade`
or
`$ mysql codepush < ./sql/codepush-v0.4.0-patch.sql`

- 处理存量数据
- Process Existing Data
``` shell
$ git clone https://github.com/lisong/tools
$ cd tools
$ npm i
$ vim ./bin/fixMinMaxVersion //修改数据配置
$ node ./bin/fixMinMaxVersion //出现提示 success
$ vim ./bin/fixMinMaxVersion //modify data configuration
$ node ./bin/fixMinMaxVersion //success prompt will appear
```

## 0.3.x

- 支持灰度发布
- 适配`code-push app add` 命令,应用不再以名字区分平台,而是以类型区分平台
- 数据库表apps新增字段`os`,`platform`
- 完善`code-push release/release-react/release-cordova` 命令
- 数据库表packages新增`is_disabled`,`rollout`字段
- 适配`code-push patch`命令
- 新增`log_report_download`,`log_report_deploy`日志表
- 升级npm依赖包
- Support for gray release
- Adapted to `code-push app add` command, applications are now distinguished by type rather than name
- Added `os`, `platform` fields to apps database table
- Improved `code-push release/release-react/release-cordova` commands
- Added `is_disabled`, `rollout` fields to packages database table
- Adapted to `code-push patch` command
- Added `log_report_download`, `log_report_deploy` log tables
- Upgraded npm dependencies
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ CodePush Server is a CodePush progam server! microsoft CodePush cloud is slow in
- oss *storage bundle file in [aliyun](https://www.aliyun.com/product/oss)*
- tencentcloud *storage bundle file in [tencentcloud](https://cloud.tencent.com/product/cos)*

## 正确使用code-push热更新
## Proper Usage of Code-Push Hot Updates

- 苹果App允许使用热更新[Apple's developer agreement](https://developer.apple.com/programs/ios/information/iOS_Program_Information_4_3_15.pdf), 为了不影响用户体验,规定必须使用静默更新。 Google Play不能使用静默更新,必须弹框告知用户App有更新。中国的android市场必须采用静默更新(如果弹框提示,App会被“请上传最新版本的二进制应用包”原因驳回)。
- react-native 不同平台bundle包不一样,在使用code-push-server的时候必须创建不同的应用来区分(eg. CodePushDemo-ios CodePushDemo-android)
- react-native-code-push只更新资源文件,不会更新java和Objective C,所以npm升级依赖包版本的时候,如果依赖包使用的本地化实现, 这时候必须更改应用版本号(ios修改Info.plist中的CFBundleShortVersionString, android修改build.gradle中的versionName), 然后重新编译app发布到应用商店。
- 推荐使用code-push release-react 命令发布应用,该命令合并了打包和发布命令(eg. code-push release-react CodePushDemo-ios ios -d Production)
- 每次向App Store提交新的版本时,也应该基于该提交版本同时向code-push-server发布一个初始版本。(因为后面每次向code-push-server发布版本时,code-puse-server都会和初始版本比较,生成补丁版本)
- Apple Apps allow hot updates according to [Apple's developer agreement](https://developer.apple.com/programs/ios/information/iOS_Program_Information_4_3_15.pdf). To maintain a good user experience, silent updates are required. Google Play does not allow silent updates and requires a dialog to inform users about App updates. Chinese Android markets require silent updates (if a dialog prompt is shown, the App will be rejected with the reason "Please upload the latest version of the binary application package").
- React Native bundle packages are different for different platforms, so you must create different applications to distinguish them when using code-push-server (e.g., CodePushDemo-ios and CodePushDemo-android).
- React-native-code-push only updates resource files and does not update Java and Objective C. Therefore, when upgrading npm dependency package versions, if the dependency package uses native implementations, you must change the application version number (modify CFBundleShortVersionString in Info.plist for iOS, modify versionName in build.gradle for Android), then recompile the app and publish it to the app store.
- It is recommended to use the code-push release-react command to publish applications, as this command combines packaging and publishing commands (e.g., code-push release-react CodePushDemo-ios ios -d Production).
- Every time you submit a new version to the App Store, you should also publish an initial version to code-push-server based on that submission version. (This is because code-push-server will compare each subsequent version with the initial version to generate patch versions.)


### shell login

```shell
$ code-push login http://api.code-push.com #登录
$ code-push login http://api.code-push.com #login
```

### [web](http://www.code-push.com)

访问:http://www.code-push.com
Visit: http://www.code-push.com

### client eg.

Expand Down
94 changes: 47 additions & 47 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
# docker 部署 code-push-server
# Deploy code-push-server with Docker

>该文档用于描述docker部署code-push-server,实例包含三个部分
>This document describes how to deploy code-push-server using Docker, the instance includes three parts

- code-push-server部分
- 更新包默认采用`local`存储(即存储在本地机器上)。使用docker volume存储方式,容器销毁不会导致数据丢失,除非人为删除volume。
- 内部使用pm2 cluster模式管理进程,默认开启进程数为cpu数,可以根据自己机器配置设置docker-compose.yml文件中deploy参数。
- docker-compose.yml只提供了应用的一部分参数设置,如需要设置其他配置,可以修改文件config.js
- mysql部分
- 数据使用docker volume存储方式,容器销毁不会导致数据丢失,除非人为删除volume。
- 应用请勿使用root用户,为了安全可以创建权限相对较小的权限供code-push-server使用,只需要给予`select,update,insert`权限即可。初始化数据库需要使用root或有建表权限用户
- redis部分
- `tryLoginTimes` 登录错误次数限制
- `updateCheckCache` 提升应用性能
- `rolloutClientUniqueIdCache` 灰度发布
- code-push-server part
- Update packages use `local` storage by default (stored on the local machine). Using docker volume storage method, container destruction won't cause data loss unless the volume is manually deleted.
- Uses pm2 cluster mode internally to manage processes, default process count is equal to CPU count, you can configure the deploy parameters in docker-compose.yml file according to your machine configuration.
- docker-compose.yml only provides some application parameter settings, if you need to set other configurations, you can modify the config.js file.
- mysql part
- Data uses docker volume storage method, container destruction won't cause data loss unless the volume is manually deleted.
- Applications should not use root user, for security you can create a user with relatively small permissions for code-push-server to use, only `select,update,insert` permissions are needed. Initializing the database requires root or a user with table creation permissions
- redis part
- `tryLoginTimes` login error count limit
- `updateCheckCache` improves application performance
- `rolloutClientUniqueIdCache` gray release

## 安装docker
## Install Docker

参考docker官方安装教程
Refer to Docker's official installation guide

- [>>mac点这里](https://docs.docker.com/docker-for-mac/install/)
- [>>windows点这里](https://docs.docker.com/docker-for-windows/install/)
- [>>linux点这里](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
- [>>Click here for Mac](https://docs.docker.com/docker-for-mac/install/)
- [>>Click here for Windows](https://docs.docker.com/docker-for-windows/install/)
- [>>Click here for Linux](https://docs.docker.com/install/linux/docker-ce/ubuntu/)


`$ docker info` 能成功输出相关信息,则安装成功,才能继续下面步骤
`$ docker info` should output relevant information successfully, then the installation is successful and you can proceed with the following steps

## 启动swarm
## Start Swarm

```shell
$ sudo docker swarm init
```


## 获取代码
## Get Code

```shell
$ git clone https://github.com/lisong/code-push-server.git
$ cd code-push-server/docker
```

## 修改配置文件
## Modify Configuration File

```shell
$ vim docker-compose.yml
```

*将`DOWNLOAD_URL`中`YOU_MACHINE_IP`替换成本机外网ip或者域名*
*Replace `YOU_MACHINE_IP` in `DOWNLOAD_URL` with your machine's external IP or domain*

*将`MYSQL_HOST`中`YOU_MACHINE_IP`替换成本机内网ip*
*Replace `YOU_MACHINE_IP` in `MYSQL_HOST` with your machine's internal IP*

*将`REDIS_HOST`中`YOU_MACHINE_IP`替换成本机内网ip*
*Replace `YOU_MACHINE_IP` in `REDIS_HOST` with your machine's internal IP*

## jwt.tokenSecret修改
## Modify jwt.tokenSecret

> code-push-server 验证登录验证方式使用的json web token加密方式,该对称加密算法是公开的,所以修改config.js中tokenSecret值很重要。
> code-push-server uses JSON web token encryption method for login verification, this symmetric encryption algorithm is public, so modifying the tokenSecret value in config.js is very important.

*非常重要!非常重要! 非常重要!*
*Very important! Very important! Very important!*

> 可以打开连接`https://www.grc.com/passwords.htm`获取 `63 random alpha-numeric characters`类型的随机生成数作为密钥
> You can open the link `https://www.grc.com/passwords.htm` to get a random number of type `63 random alpha-numeric characters` as the key

## 部署
## Deploy

```shell
$ sudo docker stack deploy -c docker-compose.yml code-push-server
```

> 如果网速不佳,需要漫长而耐心的等待。。。去和妹子聊会天吧^_^
> If the network speed is poor, you'll need to wait patiently... go chat with your friends meanwhile ^_^


## 查看进展
## Check Progress

```shell
$ sudo docker service ls
Expand All @@ -77,13 +77,13 @@ $ sudo docker service ps code-push-server_redis
$ sudo docker service ps code-push-server_server
```

> 确认`CURRENT STATE` `Running about ...`, 则已经部署完成
> Confirm that `CURRENT STATE` is `Running about ...`, then deployment is complete

## 访问接口简单验证
## Simple API Access Verification

`$ curl -I http://YOUR_CODE_PUSH_SERVER_IP:3000/`

返回`200 OK`
Returns `200 OK`

```http
HTTP/1.1 200 OK
Expand All @@ -100,36 +100,36 @@ Date: Sat, 25 Aug 2018 15:45:46 GMT
Connection: keep-alive
```

## 浏览器登录
## Browser Login

> 默认用户名:admin 密码:123456 记得要修改默认密码哦
> 如果登录连续输错密码超过一定次数,会限定无法再登录. 需要清空redis缓存
> Default username: admin password: 123456 Remember to change the default password
> If you enter the wrong password too many times in a row, you will be locked out. You need to clear the redis cache

```shell
$ redis-cli -p6388 # 进入redis
$ redis-cli -p6388 # enter redis
> flushall
> quit
```


## 查看服务日志
## View Service Logs

```shell
$ sudo docker service logs code-push-server_server
$ sudo docker service logs code-push-server_db
$ sudo docker service logs code-push-server_redis
```

## 查看存储 `docker volume ls`
## View Storage `docker volume ls`

DRIVER | VOLUME NAME | 描述
DRIVER | VOLUME NAME | Description
------ | ----- | -------
local | code-push-server_data-mysql | 数据库存储数据目录
local | code-push-server_data-storage | 存储打包文件目录
local | code-push-server_data-tmp | 用于计算更新包差异文件临时目录
local | code-push-server_data-redis | redis落地数据
local | code-push-server_data-mysql | Database storage data directory
local | code-push-server_data-storage | Storage package files directory
local | code-push-server_data-tmp | Temporary directory for calculating update package differences
local | code-push-server_data-redis | Redis persistent data

## 销毁退出应用
## Remove and Exit Application

```bash
$ sudo docker stack rm code-push-server
Expand Down
Loading