CONTRIBUTING.md 4.9 KB
Newer Older
1 2
# How to contribute

F
freesky-edward 已提交
3 4
### Brief Introduction

5 6 7 8 9 10 11 12 13
This project is [Apache 2.0](LICENSE) licensed and accepts contributions via pull requests. This document outlines some of the conventions on commit message formatting, contact points for developers and other resources to make getting your contribution easier.

Before you start, NOTICE that ```master``` branch is development version. ```stable``` branch
provided for customers and users. So all code modifications SHOULD be submitted to
```master``` branch, ```stable``` branch won't accept any commits.

This repository is integrated by website which will provide the final outline, so please only maintain docs in this repository.
anything others like styles, js are maintained in website as a combined hugo theme.

F
freesky-edward 已提交
14
Contents oranganized by hugo book  which is a framework helping build our own book.
15 16 17 18 19
please refer to hugo book [website](https://github.com/alex-shpak/hugo-book) for more detailed information.

All files are written with MarkDown syntax, please note: If you want to add internal links,
be careful to point to the .html pages corresponding to the .md pages of the folder.

F
freesky-edward 已提交
20
### Debug local
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

This doc only provides running test on linux, please prepare linux server before running 
following commands.

1. Install hugo on server

hugo can be installed easily after nodejs is ready.

```
curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_0.56.3_Linux-64bit.tar.gz | tar -xz && \
    mv hugo /usr/local/bin/
```

2. Running this repository locally

```
hugo serve --bind 0.0.0.0 --port 80 --baseUrl /
```

F
freesky-edward 已提交
40
The website will serving on http://your-server-ip:80
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55


### Debug with docker

1. Build Image

```
docker build -t docs:v0.0.1 .
```

note: here ```docs``` is the image name, you can change it as you need.

2. Running in container

```
F
freesky-edward 已提交
56
docker run -p 80:80 -d docs:v0.0.1 > docs.pid
57 58 59 60 61 62 63 64 65 66
```

The website will serving on http://your-server-ip:80

3. Stopping the container

```
docker rm -f `cat docs.pid` && rm -f docs.pid
```

67 68 69 70
***Note***: 
The defalut language(en) will serving on http://your-server-ip/
Other language(zh) will serving on http://your-server-ip/zh

71 72 73 74 75 76 77 78 79 80 81 82 83
### Add/Modify file

Before openning a PR, running locally and have a check would be good step that will help
your commits be merged quickly.

There are two kinds of Markdown file, one is the content files which locates in ```content/docs``` folder.
the other one is the menu file which locates in ```content/menu``` folder. please remember to update menu if
adding new file.

Note: menu file home file name must be named ```home.md```.

## Getting help

F
freesky-edward 已提交
84 85
- IRC: TODO 
- Mail: TODO  
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167

## Report issues

A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate a well-written, thorough bug report and feature propose, and will thank you for it!

### Issues format

When reporting issues, refer to this format:

- Is this a BUG REPORT or FEATURE REQUEST?
- What happened?
- What you expected to happen?
- What happened?
- How to reproduce it (as minimally and precisely as possible)
- Anything else we need to know?
- Environment

See more about [ISSUE_TEMPLATE](.github/ISSUE_TEMPLATE.md).

## Submit pull requests

If you are a beginner and expect this project as the gate to open source world, this tutorial is one of the best
choices for you. Just follow the guidance and you will find the pleasure to becoming a contributor.

### Step 1: Fork repository

Before making modifications of this project, you need to make sure that this project have been forked to your own
repository. It means that there will be parallel development between this repo and your own repo, so be careful
to avoid the inconsistency between these two repos.

### Step 2: Clone the remote repository

If you want to download the code to the local machine, ```git``` is the best way:
```
git clone https://your_repo_url/projectname.git
```

### Step 3: Develop code locally

To avoid inconsistency between multiple branches, we SUGGEST checking out to a new branch:
```
git checkout -b new_branch_name origin/master
```
Then you can change the code arbitrarily.

### Step 4: Push the code to the remote repository

After updating the code, you should push the update in the formal way:
```
git add .
git status (Check the update status)
git commit -m "Your commit title"
git commit --amend (Add the concrete description of your commit)
git push origin new_branch_name
```

### Step 5: Pull a request to repository

In the last step, your need to pull a compare request between your new branch and development branch. After
finishing the pull request, the CI will be automatically set up for building test.

### Pull requests format

When submitting pull requests, refer to this format:

- What this PR does / why we need it?
- Which issue this PR fixes?
- Special notes for your reviewer
- Release note

See more about [PULL_REQUEST_TEMPLATE](.github/PULL_REQUEST_TEMPLATE.md).

### Code style

```TO BE DEFINED```