[ZEPPELIN-715]Provide version information

This commit is contained in:
Minwoo Kang 2016-03-23 16:07:35 +09:00
parent d60f41a6d9
commit d0542277d2
5 changed files with 23 additions and 19 deletions

View file

@ -81,6 +81,18 @@ function addJarInDir(){
fi
}
ZEPPELIN_COMMANDLINE_MAIN=org.apache.zeppelin.utils.CommandLineUtils
function getZeppelinVersion(){
if [[ -d "${ZEPPELIN_HOME}/zeppelin-server/target/classes" ]]; then
ZEPPELIN_CLASSPATH+=":${ZEPPELIN_HOME}/zeppelin-server/target/classes"
fi
addJarInDir "${ZEPPELIN_HOME}/zeppelin-server/target/lib"
CLASSPATH+=":${ZEPPELIN_CLASSPATH}"
$ZEPPELIN_RUNNER -cp $CLASSPATH $ZEPPELIN_COMMANDLINE_MAIN -version
exit 0
}
# Text encoding for
# read/write job into files,
# receiving/displaying query/result.

View file

@ -23,7 +23,7 @@ function usage() {
echo "usage) $0 -p <port> -d <interpreter dir to load> -l <local interpreter repo dir to load>"
}
while getopts "hp:d:l:" o; do
while getopts "hp:d:l:v" o; do
case ${o} in
h)
usage
@ -38,6 +38,10 @@ while getopts "hp:d:l:" o; do
l)
LOCAL_INTERPRETER_REPO=${OPTARG}
;;
v)
. "${bin}/common.sh"
getZeppelinVersion
;;
esac
done
@ -49,12 +53,6 @@ fi
. "${bin}/common.sh"
ZEPPELIN_COMMANDLINE_MAIN=org.apache.zeppelin.utils.CommandLineUtils
if [ "$1" == "-version" ] || [ "$1" == "-v" ]; then
$ZEPPELIN_RUNNER $ZEPPELIN_COMMANDLINE_MAIN $1
exit 0
fi
ZEPPELIN_CLASSPATH+=":${ZEPPELIN_CONF_DIR}"
# construct classpath

View file

@ -19,7 +19,7 @@
# description: Start and stop daemon script for.
#
USAGE="Usage: zeppelin-daemon.sh [--config <conf-dir>] {start|stop|upstart|restart|reload|status|version(v)}"
USAGE="Usage: zeppelin-daemon.sh [--config <conf-dir>] {start|stop|upstart|restart|reload|status|version}"
if [[ "$1" == "--config" ]]; then
shift
@ -44,12 +44,6 @@ BIN=$(cd "${BIN}">/dev/null; pwd)
. "${BIN}/common.sh"
. "${BIN}/functions.sh"
ZEPPELIN_COMMANDLINE_MAIN=org.apache.zeppelin.utils.CommandLineUtils
if [ "$1" == "-version" ] || [ "$1" == "-v" ]; then
$ZEPPELIN_RUNNER $ZEPPELIN_COMMANDLINE_MAIN $1
exit 0
fi
HOSTNAME=$(hostname)
ZEPPELIN_NAME="Zeppelin"
ZEPPELIN_LOGFILE="${ZEPPELIN_LOG_DIR}/zeppelin-${ZEPPELIN_IDENT_STRING}-${HOSTNAME}.log"
@ -264,6 +258,9 @@ case "${1}" in
status)
find_zeppelin_process
;;
version | v | -v | -version)
getZeppelinVersion
;;
*)
echo ${USAGE}
esac

View file

@ -39,10 +39,8 @@ bin=$(cd "${bin}">/dev/null; pwd)
. "${bin}/common.sh"
ZEPPELIN_COMMANDLINE_MAIN=org.apache.zeppelin.utils.CommandLineUtils
if [ "$1" == "-version" ] || [ "$1" == "-v" ]; then
$ZEPPELIN_RUNNER $ZEPPELIN_COMMANDLINE_MAIN $1
exit 0
getZeppelinVersion
fi
HOSTNAME=$(hostname)

View file

@ -33,7 +33,6 @@ import java.util.Properties;
public class Util {
private static final String PROJECT_PROPERTIES_VERSION_KEY = "version";
static Logger logger = LoggerFactory.getLogger(Util.class);
private static Properties projectProperties;
static {
@ -41,7 +40,7 @@ public class Util {
try {
projectProperties.load(Util.class.getResourceAsStream("/project.properties"));
} catch (IOException e) {
logger.error("Fail to read project.properties");
//Fail to read project.properties
}
}