Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7A028200D23 for ; Thu, 19 Oct 2017 13:20:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 789801609E2; Thu, 19 Oct 2017 11:20:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BDE4A1609ED for ; Thu, 19 Oct 2017 13:20:40 +0200 (CEST) Received: (qmail 76781 invoked by uid 500); 19 Oct 2017 11:20:39 -0000 Mailing-List: contact commits-help@sentry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sentry.apache.org Delivered-To: mailing list commits@sentry.apache.org Received: (qmail 76765 invoked by uid 99); 19 Oct 2017 11:20:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 11:20:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 879A8DFB0E; Thu, 19 Oct 2017 11:20:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@sentry.apache.org Date: Thu, 19 Oct 2017 11:20:40 -0000 Message-Id: <210256f8c0f242108334e162d93b7c19@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/5] sentry git commit: Adding Script to run the CLI + adding sentry-tools to build cycle archived-at: Thu, 19 Oct 2017 11:20:41 -0000 Adding Script to run the CLI + adding sentry-tools to build cycle Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/10dec6b6 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/10dec6b6 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/10dec6b6 Branch: refs/heads/akolb-cli Commit: 10dec6b605678faef8a491191fa4a7ef788ddeb1 Parents: d9dbe56 Author: Colm O hEigeartaigh Authored: Thu Oct 19 11:48:26 2017 +0100 Committer: Colm O hEigeartaigh Committed: Thu Oct 19 11:48:26 2017 +0100 ---------------------------------------------------------------------- bin/sentryCli | 59 +++++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 1 + sentry-tools/pom.xml | 2 +- 3 files changed, 61 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/10dec6b6/bin/sentryCli ---------------------------------------------------------------------- diff --git a/bin/sentryCli b/bin/sentryCli new file mode 100755 index 0000000..02e9edd --- /dev/null +++ b/bin/sentryCli @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bin=`dirname "$0"` +myhome=`cd "$bin/.."; pwd` + +if [[ -z $SENTRY_HOME ]] ; then + export SENTRY_HOME=$myhome +fi + +# check for hadoop in the path +HADOOP_IN_PATH=`which hadoop 2>/dev/null` +if [ -f ${HADOOP_IN_PATH} ]; then + HADOOP_DIR=`dirname "$HADOOP_IN_PATH"`/.. +fi +# HADOOP_HOME env variable overrides hadoop in the path +HADOOP_HOME=${HADOOP_HOME:-${HADOOP_PREFIX:-$HADOOP_DIR}} +if [ "$HADOOP_HOME" == "" ]; then + echo "Cannot find hadoop installation: \$HADOOP_HOME or \$HADOOP_PREFIX must be set or hadoop must be in the path"; + exit 4; +fi + +HADOOP=$HADOOP_HOME/bin/hadoop +if [ ! -f ${HADOOP} ]; then + echo "Cannot find hadoop installation: \$HADOOP_HOME or \$HADOOP_PREFIX must be set or hadoop must be in the path"; + exit 4; +fi + +export _CMD_JAR=${SENTRY_SHELL_JAR:-sentry-provider-db-*.jar} +for f in ${SENTRY_HOME}/lib/*.jar; do + HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${f} +done +export HADOOP_CLASSPATH + +for f in ${SENTRY_HOME}/lib/server/*.jar; do + HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${f} +done +for f in ${SENTRY_HOME}/lib/plugins/*.jar; do + HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${f} +done + +args=() +shell=org.apache.sentry.shell.SentryCli + +exec $HADOOP jar ${SENTRY_HOME}/lib/${_CMD_JAR} $shell http://git-wip-us.apache.org/repos/asf/sentry/blob/10dec6b6/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 1c05556..02cf8f7 100644 --- a/pom.xml +++ b/pom.xml @@ -627,6 +627,7 @@ limitations under the License. sentry-tests sentry-hdfs sentry-solr + sentry-tools sentry-dist http://git-wip-us.apache.org/repos/asf/sentry/blob/10dec6b6/sentry-tools/pom.xml ---------------------------------------------------------------------- diff --git a/sentry-tools/pom.xml b/sentry-tools/pom.xml index ed0fb92..5d4cb2a 100644 --- a/sentry-tools/pom.xml +++ b/sentry-tools/pom.xml @@ -60,4 +60,4 @@ limitations under the License. - \ No newline at end of file +