diff --git a/docs/docs/game/github-introduction.md b/docs/docs/game/github-introduction.md index 3b1954a9f..1d766dc70 100644 --- a/docs/docs/game/github-introduction.md +++ b/docs/docs/game/github-introduction.md @@ -6,8 +6,6 @@ title: MiniOB GitHub 在训练营中的使用说明 ## 简介 -训练营测试后端现在支持使用 [GitHub](https://github.com) 和 [Gitee](https://gitee.com) 作为代码仓库管理平台。 - 本文介绍如何在GitHub上创建私有仓库,并将MiniOB代码提交到自己的仓库中,然后在训练营中进行测试。 MiniOB 仓库地址: @@ -48,7 +46,51 @@ https://github.com/oceanbase/miniob ![view repo](images/github-view-repo.png) -6. 邀请OceanBase测试账号 +## 仓库权限设置 + +到此为止,已经创建完了私有仓库,并导入了代码。但是此时官方测试账号并没有权限查看你的代码,接下来需要给官方测试账号添加权限。有两种方法,一种是生成token,另一种是邀请OceanBase测试账号。 + +### 生成token +1. 在GitHub页面,点击个人头像,选择"Settings",进入个人设置页面。 +![personal settings](images/github-personal-settings.png) + +2. 接着在左侧导航栏中选择"Developer settings",进入开发者设置页面。 +![develop settings](images/github-developer-settings.png) + +3. 找到生成新token的页面。 +![generate new token](images/github-generate-new-token.png) + +4. 填写token的信息,生成token。 +![fill out token info](images/github-fill-out-token-form.jpg) + +5. 生成token后要第一时间保存,离开页面后将无法再次查看。 +![save token](images/github-save-token.png) + +6. 验证token是否生效 +执行 git clone 命令,URL中带上 username和token,如果能够正常clone,则说明token生效。 + +```bash +git clone https://`your-github-username`:`github_pat_your-github-token`@github.com/`repo-owner`/`repo-name` +``` + +> your-github-username 替换成你的GitHub用户名
+> github_pat_your-github-token 替换成你的生成的token
+> repo-owner 替换成你的仓库所属者,通常也是你的GitHub用户名
+> repo-name 替换成你的仓库名,比如 miniob-2024 + +比如: + +```bash +git clone https://hnwyllmm:github_pat_token@github.com/hnwyllmm/miniob-2023 +``` + +一个clone成功的例子 +![validate token](images/github-validate-token.png) + +**注意:提测时的URL需要填写带user:token的地址** +![commit](images/github-commit-info.png) + +### 邀请OceanBase测试账号 点击"Settings"标签,进入仓库设置页面,点击"Collaborators"标签,进入仓库权限管理页面。 @@ -66,8 +108,9 @@ GitHub 在邀请别人加入仓库时,会发送邮件通知被邀请人,需 ![pending invite](images/github-pending-invite.png) -![invite success](images/images/github-invite-success.png) +![invite success](images/github-invite-success.png) -7. 提交测试 +## 提交测试 -等官网人员通过邀请后,就可以提交测试了。训练营的使用说明不再赘述,可以参考 [训练营使用说明](https://ask.oceanbase.com/t/topic/35600372)。 +如果是邀请OceanBase测试账号,需要等官网人员通过邀请后,开始提交测试。 +训练营的使用说明不再赘述,可以参考 [训练营使用说明](https://ask.oceanbase.com/t/topic/35600372)。 diff --git a/docs/docs/game/images/github-commit-info.png b/docs/docs/game/images/github-commit-info.png new file mode 100644 index 000000000..96823dd82 Binary files /dev/null and b/docs/docs/game/images/github-commit-info.png differ diff --git a/docs/docs/game/images/github-developer-settings.png b/docs/docs/game/images/github-developer-settings.png new file mode 100644 index 000000000..4ff7b2c03 Binary files /dev/null and b/docs/docs/game/images/github-developer-settings.png differ diff --git a/docs/docs/game/images/github-fill-out-token-form.jpg b/docs/docs/game/images/github-fill-out-token-form.jpg new file mode 100644 index 000000000..4a8b1af66 Binary files /dev/null and b/docs/docs/game/images/github-fill-out-token-form.jpg differ diff --git a/docs/docs/game/images/github-generate-new-token.png b/docs/docs/game/images/github-generate-new-token.png new file mode 100644 index 000000000..a2406c78d Binary files /dev/null and b/docs/docs/game/images/github-generate-new-token.png differ diff --git a/docs/docs/game/images/github-personal-settings.png b/docs/docs/game/images/github-personal-settings.png new file mode 100644 index 000000000..8d11a2ea5 Binary files /dev/null and b/docs/docs/game/images/github-personal-settings.png differ diff --git a/docs/docs/game/images/github-save-token.png b/docs/docs/game/images/github-save-token.png new file mode 100644 index 000000000..13eb93180 Binary files /dev/null and b/docs/docs/game/images/github-save-token.png differ diff --git a/docs/docs/game/images/github-validate-token.png b/docs/docs/game/images/github-validate-token.png new file mode 100644 index 000000000..49aa8e0b7 Binary files /dev/null and b/docs/docs/game/images/github-validate-token.png differ diff --git a/docs/docs/how_to_build.md b/docs/docs/how_to_build.md index 18750178b..8119b4ac7 100644 --- a/docs/docs/how_to_build.md +++ b/docs/docs/how_to_build.md @@ -18,6 +18,10 @@ MiniOB 需要使用: 如果是第一次在这个环境上编译miniob,需要安装一些miniob的依赖库,执行下面的命令即可安装: +> 重要提示:如果使用Windows系统,请先配置 git autocrlf 为 false。 +> 执行:`git config --global core.autocrlf false` +> 防止脚本换行符被修改。 + ```bash bash build.sh init ``` @@ -132,6 +136,23 @@ sudo bash build.sh init 则不会因为找不到cmake而报错。 +### 2. build.sh: line 2: $'\r': command not found +在执行build.sh脚本时,遇到下面的错误 +![crlf error](images/miniob-build-crlf.png) + +通常是使用Windows电脑下载源码,然后在docker或虚拟机中运行build.sh脚本运行时出现这个错误。 + +***解决方法:*** + +执行下面的脚本,设置git不要切换换行符。 +```bash +git config --global core.autocrlf false +``` +然后删除源码重新下载(clone)。 + +***问题原因:*** +在Windows上git clone源码后,文本文件(包括build.sh)换行符被修改为 '\r\n'(CRLF),这个换行符在Linux上不能识别,Linux的换行符是'\n'(LF)。 + **更多信息:** 关于该问题的更多细节,请参考[问题来源](https://ask.oceanbase.com/t/topic/35604437/7)。 diff --git a/docs/docs/images/miniob-build-crlf.png b/docs/docs/images/miniob-build-crlf.png new file mode 100644 index 000000000..c1fcc3d3e Binary files /dev/null and b/docs/docs/images/miniob-build-crlf.png differ