Repository: spark
Updated Branches:
  refs/heads/master d47a25f68 -> 541d7e1e4


[SPARK-25685][BUILD] Allow running tests in Jenkins in enterprise Git repository

## What changes were proposed in this pull request?

Many companies have their own enterprise GitHub to manage Spark code. To build 
and test in those repositories with Jenkins need to modify this script.
So I suggest to add some environment variables to allow regression testing in 
enterprise Jenkins instead of default Spark repository in GitHub.

## How was this patch tested?

Manually test.

Closes #22678 from LantaoJin/SPARK-25685.

Lead-authored-by: lajin <[email protected]>
Co-authored-by: LantaoJin <[email protected]>
Signed-off-by: Sean Owen <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/541d7e1e
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/541d7e1e
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/541d7e1e

Branch: refs/heads/master
Commit: 541d7e1e4ba837f69d6f545b669185df91e8f406
Parents: d47a25f
Author: lajin <[email protected]>
Authored: Fri Oct 12 12:41:33 2018 -0500
Committer: Sean Owen <[email protected]>
Committed: Fri Oct 12 12:41:33 2018 -0500

----------------------------------------------------------------------
 dev/run-tests-jenkins.py |  6 ++++--
 docs/building-spark.md   | 28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/541d7e1e/dev/run-tests-jenkins.py
----------------------------------------------------------------------
diff --git a/dev/run-tests-jenkins.py b/dev/run-tests-jenkins.py
index eca88f2..77d751f 100755
--- a/dev/run-tests-jenkins.py
+++ b/dev/run-tests-jenkins.py
@@ -39,7 +39,8 @@ def print_err(msg):
 def post_message_to_github(msg, ghprb_pull_id):
     print("Attempting to post to Github...")
 
-    url = "https://api.github.com/repos/apache/spark/issues/"; + ghprb_pull_id 
+ "/comments"
+    api_url = os.getenv("GITHUB_API_BASE", 
"https://api.github.com/repos/apache/spark";)
+    url = api_url + "/issues/" + ghprb_pull_id + "/comments"
     github_oauth_key = os.environ["GITHUB_OAUTH_KEY"]
 
     posted_message = json.dumps({"body": msg})
@@ -176,7 +177,8 @@ def main():
     build_display_name = os.environ["BUILD_DISPLAY_NAME"]
     build_url = os.environ["BUILD_URL"]
 
-    commit_url = "https://github.com/apache/spark/commit/"; + 
ghprb_actual_commit
+    project_url = os.getenv("SPARK_PROJECT_URL", 
"https://github.com/apache/spark";)
+    commit_url = project_url + "/commit/" + ghprb_actual_commit
 
     # GitHub doesn't auto-link short hashes when submitted via the API, 
unfortunately. :(
     short_commit_hash = ghprb_actual_commit[0:7]

http://git-wip-us.apache.org/repos/asf/spark/blob/541d7e1e/docs/building-spark.md
----------------------------------------------------------------------
diff --git a/docs/building-spark.md b/docs/building-spark.md
index 55830d3..b2775d2 100644
--- a/docs/building-spark.md
+++ b/docs/building-spark.md
@@ -260,3 +260,31 @@ For SBT, specify a complete scala version using (e.g. 
2.12.6):
     ./build/sbt -Dscala.version=2.12.6
 
 Otherwise, the sbt-pom-reader plugin will use the `scala.version` specified in 
the spark-parent pom.
+
+## Running Jenkins tests with Github Enterprise
+
+To run tests with Jenkins:
+
+    ./dev/run-tests-jenkins
+
+If use an individual repository or a repository on GitHub Enterprise, export 
below environment variables before running above command.
+
+### Related environment variables
+
+<table class="table">
+<tr><th>Variable Name</th><th>Default</th><th>Meaning</th></tr>
+<tr>
+  <td><code>SPARK_PROJECT_URL</code></td>
+  <td>https://github.com/apache/spark</td>
+  <td>
+    The Spark project URL of GitHub Enterprise.
+  </td>
+</tr>
+<tr>
+  <td><code>GITHUB_API_BASE</code></td>
+  <td>https://api.github.com/repos/apache/spark</td>
+  <td>
+    The Spark project API server URL of GitHub Enterprise.
+  </td>
+</tr>
+</table>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to