This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git


The following commit(s) were added to refs/heads/master by this push:
     new bb37e92  Add page for how to use SonarCloud
bb37e92 is described below

commit bb37e927f6be39f05c6ebf0701417c5d7f979db1
Author: Daniel Qian <[email protected]>
AuthorDate: Fri Nov 15 17:02:26 2019 +0800

    Add page for how to use SonarCloud
---
 _data/navigation.yml                |  5 +++++
 _developers/cn/sonarcloud-how-to.md | 44 +++++++++++++++++++++++++++++++++++++
 _developers/sonarcloud-how-to.md    | 44 +++++++++++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+)

diff --git a/_data/navigation.yml b/_data/navigation.yml
index 150c052..5d6e8a9 100755
--- a/_data/navigation.yml
+++ b/_data/navigation.yml
@@ -113,6 +113,9 @@ t:
         url: /developers/release-guide/
       - title: "How to verify Apache Release"
         url: /developers/release-validation-guide/
+      - title: "How to Use SonarCloud"
+        url: /developers/sonarcloud-how-to/
+
 
     faqs:
       - title: "FAQ"
@@ -279,6 +282,8 @@ t:
         url: /cn/developers/release-guide/
       - title: "ServiceComb发版验证指南"
         url: /cn/developers/release-validation-guide/
+      - title: "SonarCloud集成指南"
+        url: /cn/developers/sonarcloud-how-to/
 
     faqs:
       - title: "常见问题"
diff --git a/_developers/cn/sonarcloud-how-to.md 
b/_developers/cn/sonarcloud-how-to.md
new file mode 100755
index 0000000..e448c55
--- /dev/null
+++ b/_developers/cn/sonarcloud-how-to.md
@@ -0,0 +1,44 @@
+---
+title: "SonarCloud集成指南"
+lang: cn
+ref: sonarcloud-how-to
+permalink: /cn/developers/sonarcloud-how-to/
+excerpt: "SonarCloud集成指南"
+last_modified_at:  2019-11-15T16:55:44+08:00
+author: Daniel Qian
+redirect_from:
+  - /theme-setup/
+---
+
+{% include toc %}
+
+本文向大家介绍如何在Apache ServiceComb中集成SonarCloud。
+
+## 步骤
+
+1. 首先你是Github的Apache组织的成员。
+2. 用你的Github账号登录 [sonarcloud.io](https://sonarcloud.io)。
+3. 在 [Jira Infrastructure ](https://issues.apache.org/jira/projects/INFRA/) 
创建一个JIRA请求在SonarCloud中创建项目,样式可参考[这个](https://issues.apache.org/jira/browse/INFRA-19444)。在这个JIRA中要提供仓库的Github地址,project-key(在SonarCloud中唯一表示你项目的ID),作为项目Admin的Github账号,一般来说就是你自己。
+4. 等待INFRA团队替你创建项目。然后你能在SonarCloud中看到了。
+5. 根据SonarCloud中的指示修改你的`.travis.yml`
+
+注意:
+
+因为Travis不支持在PR中启用SonarCloud集成,因此你需要对构建脚本做类似下面的改动:
+
+```bash
+echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
+if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
+  echo "Not a pull request build, running build with sonar"
+  mvn ... sonar:sonar -Dsonar.projectKey=<project-key>
+else
+  echo "Pull request build or local build"
+  mvn ...
+fi;
+```
+
+## 参考资料
+
+* [Apache CWiki - SonarQube 
Analysis](https://cwiki.apache.org/confluence/display/INFRA/SonarQube+Analysis)
+* [Travis - SonarCloud](https://docs.travis-ci.com/user/sonarcloud/)
+
diff --git a/_developers/sonarcloud-how-to.md b/_developers/sonarcloud-how-to.md
new file mode 100755
index 0000000..7937055
--- /dev/null
+++ b/_developers/sonarcloud-how-to.md
@@ -0,0 +1,44 @@
+---
+title: "How to Use SonarCloud"
+lang: en
+ref: sonarcloud-how-to
+permalink: /developers/sonarcloud-how-to/
+excerpt: "SonarCloud集成指南"
+last_modified_at:  2019-11-15T16:55:44+08:00
+author: Daniel Qian
+redirect_from:
+  - /theme-setup/
+---
+
+{% include toc %}
+
+This guide helps you to integrate SonarCloud in your Travis build.
+
+## Steps
+
+1. First, you should be member of Apache Orgnization in Github.
+2. Login to  [sonarcloud.io](https://sonarcloud.io) with your Github 
credentials.
+3. Create an JIRA ticket in  [Infrastructure 
](https://issues.apache.org/jira/projects/INFRA/) asking to create a project at 
SonarCloud, here is an 
[example](https://issues.apache.org/jira/browse/INFRA-19444). You should provde 
Github repo url, project-key (the id of your project in SonarCloud), Github id 
for the Admin of this project, generally speaking that's yours.
+4. Wait for the INFRA team creating the project, after that you will see it at 
SonarCloud.
+5. Follow the SonarCloud instructions modify project's `.travis.yml`
+
+Notice:
+
+Because Travis doesn't support SonarCloud in PR build, you should modify your 
build script like this:
+
+```bash
+echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
+if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
+  echo "Not a pull request build, running build with sonar"
+  mvn ... sonar:sonar -Dsonar.projectKey=<project-key>
+else
+  echo "Pull request build or local build"
+  mvn ...
+fi;
+```
+
+## References
+
+* [Apache CWiki - SonarQube 
Analysis](https://cwiki.apache.org/confluence/display/INFRA/SonarQube+Analysis)
+* [Travis - SonarCloud](https://docs.travis-ci.com/user/sonarcloud/)
+

Reply via email to