Skip to content

Commit

Permalink
add docs (#2)
Browse files Browse the repository at this point in the history
* docs: update site
  • Loading branch information
zhuyali1995 authored and xudafeng committed Jan 16, 2019
1 parent 5a997a8 commit 2de51d2
Show file tree
Hide file tree
Showing 19 changed files with 363 additions and 21 deletions.
22 changes: 17 additions & 5 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
macacaEcosystem.en,
],
sidebar: {
'/guide/': genSidebarConfig('Guide', 'Usage', 'Advanced'),
'/guide/': genSidebarConfig(['Guide', 'CI/CD', 'Community']),
},
},
'/zh/': {
Expand All @@ -90,20 +90,32 @@ module.exports = {
macacaEcosystem.zh,
],
sidebar: {
'/zh/guide/': genSidebarConfig('指南'),
'/zh/guide/': genSidebarConfig(['使用指南', '持续集成', '社区支持']),
},
},
},
},
};

function genSidebarConfig(guide) {
function genSidebarConfig(arr) {
return [
{
title: guide,
title: arr[0],
collapsable: false,
children: [
'',
'reliable-cli',
'reliable-web-deploy',
],
},
{
title: arr[1],
collapsable: false,
children: [
'integrate-with-jenkins',
'jenkins-web',
'jenkins-ios',
'jenkins-android',
'integrate-with-gitlab-ci',
],
},
];
Expand Down
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ Reliable is suitable for working with existing R&D processes in the continuous i
:::

![](https://wx3.sinaimg.cn/large/6d308bd9ly1fz3wii2wqsj21bh0u0qij.jpg)

::: tip Deploy
Reliable supports one-click deployment, quickly has your own test management platform.
:::

![](http://ww2.sinaimg.cn/large/6d308bd9gw1f5scrp1p4rj20rs0gatbj.jpg)
3 changes: 0 additions & 3 deletions docs/archive/integrate-with-gitlab-ci.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/archive/integrate-with-gitlab-ci.zh-CN.md

This file was deleted.

25 changes: 25 additions & 0 deletions docs/guide/integrate-with-gitlab-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Integrate With Gitlab CI

---

> GitLab is a single application for the entire DevOps lifecycle.
## Configuration

Set `RELIABLE_SERVER_URL` on demand.

```yaml
before_script:
- export MARMOT_SERVER_URL=http://reliable-host
- export PATH=$PWD/node_modules/.bin:$PATH
- echo $PATH
test:
image: macacajs/macaca-electron-docker
script:
- npm i reliable-cli
- reliable report
tags:
- swarm
```
[gitlab]: https://about.gitlab.com/install/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Integrate With Jenkins
# Integrate With Jenkins

---

Expand Down Expand Up @@ -52,4 +52,4 @@ Change `$HOME/reliable_home/jenkins_home/config.xml` useSecurity to false, and r

- [jenkins-android.md](./jenkins-android.md)
- [jenkins-ios.md](./jenkins-ios.md)
- [jenkins-web.md](./jenkins-web.md)
- [jenkins-web.md](./jenkins-web.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
138 changes: 138 additions & 0 deletions docs/guide/reliable-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Reliable-CLI

---

## Installment

```bash
$ npm i reliable-cli -g
```

## Usage

### report

```bash
$ reliable report -c ./reliable.config.js
```

## Configuration

```javascript
module.exports = {
files: [
`build/Release-iphonesimulator/${pkg.name}.app`
],
packages: [
{
version,
path: `${pkg.name}.app`,
}
],
testInfo: {
},
extraInfo: {
}
};
```


| key | value type | description |
| --- | --- | --- |
| files | `string[]` | extra build artifacts |
| packages | `Obejct[]` | core build artifacts |
| testInfo | `Object` | test coverage report |
| extraInfo | `Object` | extra infomation |
| environment | `Object` | ci runner environment |
| gitCommitInfo | `Object` | last commit log by [last-commit-log](//github.com/node-modules/last-commit-log/) |


```json
{
"files": [],
"packages": [
],
"testInfo": {
"tests": 4,
"passes": 4,
"linePercent": 91.67,
"passPercent": 100,
"testHtmlReporterPath": "http://your-storage-host/example/c153d93/reports/index.html",
"coverageHtmlReporterPath": "http://your-storage-host/example/c153d93/coverage/index.html"
},
"extraInfo": {
"webpack": "4.27.1",
"macaca-wd": "2.1.8",
},
"environment": {
"ci": {
"JOB_NAME": "reliable",
"RUNNER_TYPE": "GITLAB_CI",
"BUILD_NUMBER": "123"
},
"os": {
"platform": "linux",
"nodeVersion": "v8.12.0"
},
"platform": "web"
},
"gitCommitInfo": {
"body": "",
"hash": "9a5ebe6da33ba87a2a70947db2297c0bc3195de1",
"author": {
"date": "1545019270",
"name": "user",
"email": "[email protected]",
"relativeDate": "2 minutes ago"
},
"gitTag": "",
"gitUrl": "http://gitlab.com/app/reliable",
"subject": "feat: update reliable",
"committer": {
"date": "1545019270",
"name": "user",
"email": "[email protected]",
"relativeDate": "2 minutes ago"
},
"gitBranch": "feat/toast",
"gitRemote": "http://gitlab-ci-token/app/reliable.git",
"shortHash": "9a5ebe6",
"sanitizedSubject": "feat-update"
}
}
```

## Helper Methods

User helper methods to resolve the iOS and Android platforms.

```javascript
const helper = require('reliable-cli').helper;
const {
iosUtils,
androidUtils,
webUtils,
} = helper;

// frequently methods

https://macacajs.github.io/reliable-cli/

```

## Environment Variable

| name | description |
| ----------------- | ---------------------------- |
| RELIABLE_SERVER_URL | server url for Reliable server |

```bash
$ RELIABLE_SERVER_URL=http://127.0.0.1:9900 ci.sh
```

## Integration Samples

- [ios-app-bootstrap](//github.com/app-bootstrap/ios-app-bootstrap)
- [android-app-bootstrap](//github.com/app-bootstrap/android-app-bootstrap)
- [awesome-practice-projects](//github.com/app-bootstrap/awesome-practice-projects)
- [web-app-bootstrap](//github.com/app-bootstrap/web-app-bootstrap)
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ should edit [docker-compose.yml](../docker-compose.yml) on demand.
### Using [docker](https://docs.docker.com/)
- [reliable-web](../docker/reliable-web/README.md)
- [reliable-mysql](../docker/reliable-mysql/README.md)
- [reliable-nginx](../docker/reliable-nginx/README.md)
- [reliable-web](../../docker/reliable-web/README.md)
- [reliable-mysql](../../docker/reliable-mysql/README.md)
6 changes: 6 additions & 0 deletions docs/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ Reliable 适合在持续集成阶段与现有研发流程打通和衔接,当
:::

![](https://wx3.sinaimg.cn/large/6d308bd9ly1fz3wii2wqsj21bh0u0qij.jpg)

::: tip 部署便捷
Reliable 一键部署,拥有自己的测试管理平台。
:::

![](http://ww2.sinaimg.cn/large/6d308bd9gw1f5scrp1p4rj20rs0gatbj.jpg)
23 changes: 23 additions & 0 deletions docs/zh/guide/integrate-with-gitlab-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Gitlab CI 集成

---

## GitLab-CI 配置

最简单的配置如下:

其中 RELIABLE_SERVER_URL 按照具体上报的 Reliable 事例地址。

```yaml
before_script:
- export MARMOT_SERVER_URL=http://reliable-host
- export PATH=$PWD/node_modules/.bin:$PATH
- echo $PATH
test:
image: macacajs/macaca-electron-docker
script:
- npm i reliable-cli
- reliable report
tags:
- swarm
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Jenkins 集成文档
# Jenkins 集成

---

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2de51d2

Please sign in to comment.