-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: add spark-shell wrapper with dependencies
Signed-off-by: Alexander Bezzubov <[email protected]>
- Loading branch information
Showing
4 changed files
with
30 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
hash java >/dev/null 2>&1 || { echo "Please install is Java" >&2; exit 1; } | ||
|
||
|
||
sparkShell() { | ||
if hash spark-shell 2>/dev/null; then | ||
exec spark-submit "$@" | ||
elif [[ -d "./spark" ]]; then | ||
echo "Using spark-shell from ./spark/" | ||
SPARK_HOME='' "./spark/bin/spark-shell" "$@" | ||
elif [[ -n "${SPARK_HOME}" ]]; then | ||
echo "Using spark-shell from ${SPARK_HOME}" | ||
"${SPARK_HOME}/bin/spark-shell" "$@" | ||
else | ||
echo "Please, install and configure Apache Spark and set SPARK_HOME" | ||
exit "${E_NO_SPARK}" | ||
fi | ||
} | ||
|
||
|
||
sparkShell \ | ||
--jars ./target/scala-2.11/spark-api_2.11-0.1.0-SNAPSHOT.jar \ | ||
--repositories "https://jitpack.io" \ | ||
--packages "tech.sourced:enry-java:1.0,com.github.src-d:siva-java:master-SNAPSHOT,org.eclipse.jgit:org.eclipse.jgit:4.8.0.201706111038-r,com.github.bblfsh:client-scala:v0.1.0" \ | ||
--exclude-packages "org.slf4j:slf4j-api" \ | ||
--properties-file src/main/resources/spark-config.properties \ | ||
"$@" |
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