forked from apache/incubator-pegasus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build config and add test (#2)
- Loading branch information
1 parent
5121fef
commit ed65027
Showing
16 changed files
with
1,186 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
language: scala | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
||
scala: | ||
- "2.11.7" | ||
- "2.12.7" | ||
|
||
cache: | ||
directories: | ||
- $HOME/.m2/repository | ||
- $HOME/.sbt | ||
- $HOME/.ivy2 | ||
|
||
script: | ||
- ./scripts/travis.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
version := "0.0.4-SNAPSHOT" | ||
version := "1.11.5-1-SNAPSHOT" | ||
|
||
organization := "com.xiaomi" | ||
organization := "com.xiaomi.infra" | ||
|
||
name := "pegasus-scala-client" | ||
|
||
scalaVersion := "2.11.7" | ||
scalaVersion := "2.12.7" | ||
|
||
crossScalaVersions := Seq("2.11.7", "2.12.7") | ||
|
||
publishMavenStyle := true | ||
|
||
scalafmtOnCompile := true | ||
|
||
//custom repository | ||
resolvers ++= Seq( | ||
//"Remote Maven Repository" at "http://your-url/", | ||
"Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository" | ||
) | ||
|
||
//custom publish url | ||
publishTo := { | ||
val nexus = "http://your-url/" | ||
if (isSnapshot.value) Some("snapshots" at nexus + "snapshots") | ||
else Some("releases" at nexus + "releases") | ||
} | ||
|
||
credentials += Credentials( | ||
new File((Path.userHome / ".sbt" / ".credentials").toString())) | ||
|
||
libraryDependencies ++= Seq( | ||
"com.google.guava" % "guava" % "20.0", | ||
"com.xiaomi.infra" % "pegasus-client" % "1.11.2-thrift-0.11.0-inlined", | ||
"com.google.guava" % "guava" % "21.0", | ||
"com.xiaomi.infra" % "pegasus-client" % "1.11.5-thrift-0.11.0-inlined", | ||
"org.scalatest" %% "scalatest" % "3.0.3" % Test | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.13 | ||
sbt.version=1.2.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
# scala format tool,see https://github.com/scalameta/scalafmt | ||
sbt scalafmtSbt scalafmt test:scalafmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
PROJECT_DIR=$(dirname "${SCRIPT_DIR}") | ||
cd "${PROJECT_DIR}" || exit 1 | ||
|
||
# lint all scripts, abort if there's any warning. | ||
function shellcheck_must_pass() | ||
{ | ||
if [[ $(shellcheck "$1") ]]; then | ||
echo "shellcheck $1 failed" | ||
shellcheck "$1" | ||
exit 1 | ||
fi | ||
} | ||
shellcheck_must_pass ./scripts/travis.sh | ||
|
||
# check format | ||
sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck | ||
|
||
# install java-client dependency | ||
git clone https://github.com/XiaoMi/pegasus-java-client.git | ||
cd pegasus-java-client | ||
git checkout 1.11.5-thrift-0.11.0-inlined-release | ||
mvn clean package -DskipTests | ||
mvn clean install -DskipTests | ||
cd .. | ||
|
||
# start pegasus onebox environment | ||
wget https://github.com/XiaoMi/pegasus/releases/download/v1.11.5/pegasus-server-1.11.5-ba0661d--release.zip | ||
unzip pegasus-server-1.11.5-ba0661d--release.zip | ||
cd pegasus-server-1.11.5-ba0661d--release | ||
|
||
./run.sh start_onebox -w | ||
cd ../ | ||
|
||
if ! sbt test | ||
then | ||
cd pegasus-server-1.11.5-ba0661d--release | ||
./run.sh list_onebox | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.