[ 
https://issues.apache.org/jira/browse/MINIFI-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15357847#comment-15357847
 ] 

ASF GitHub Bot commented on MINIFI-41:
--------------------------------------

Github user JPercivall commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/21#discussion_r69210176
  
    --- Diff: 
minifi-toolkit/minifi-toolkit-assembly/src/main/resources/config.sh ---
    @@ -0,0 +1,133 @@
    +#!/bin/sh
    +#
    +#    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.
    +#
    +# chkconfig: 2345 20 80
    +# description: Apache NiFi - MiNiFi
    +#
    +
    +# Script structure inspired from Apache Karaf and other Apache projects 
with similar startup approaches
    +
    +SCRIPT_DIR=$(dirname "$0")
    +SCRIPT_NAME=$(basename "$0")
    +MINIFI_TOOLKIT_HOME=$(cd "${SCRIPT_DIR}" && cd .. && pwd)
    +PROGNAME=$(basename "$0")
    +
    +
    +warn() {
    +    echo "${PROGNAME}: $*"
    +}
    +
    +die() {
    +    warn "$*"
    +    exit 1
    +}
    +
    +detectOS() {
    +    # OS specific support (must be 'true' or 'false').
    +    cygwin=false;
    +    aix=false;
    +    os400=false;
    +    darwin=false;
    +    case "$(uname)" in
    +        CYGWIN*)
    +            cygwin=true
    +            ;;
    +        AIX*)
    +            aix=true
    +            ;;
    +        OS400*)
    +            os400=true
    +            ;;
    +        Darwin)
    +            darwin=true
    +            ;;
    +    esac
    +    # For AIX, set an environment variable
    +    if ${aix}; then
    +         export LDR_CNTRL=MAXDATA=0xB0000000@DSA
    +         echo ${LDR_CNTRL}
    +    fi
    +}
    +
    +locateJava() {
    +    # Setup the Java Virtual Machine
    +    if $cygwin ; then
    +        [ -n "${JAVA}" ] && JAVA=$(cygpath --unix "${JAVA}")
    +        [ -n "${JAVA_HOME}" ] && JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")
    +    fi
    +
    +    if [ "x${JAVA}" = "x" ] && [ -r /etc/gentoo-release ] ; then
    +        JAVA_HOME=$(java-config --jre-home)
    +    fi
    +    if [ "x${JAVA}" = "x" ]; then
    +        if [ "x${JAVA_HOME}" != "x" ]; then
    +            if [ ! -d "${JAVA_HOME}" ]; then
    +                die "JAVA_HOME is not valid: ${JAVA_HOME}"
    +            fi
    +            JAVA="${JAVA_HOME}/bin/java"
    +        else
    +            warn "JAVA_HOME not set; results may vary"
    +            JAVA=$(type java)
    +            JAVA=$(expr "${JAVA}" : '.* \(/.*\)$')
    +            if [ "x${JAVA}" = "x" ]; then
    +                die "java command not found"
    +            fi
    +        fi
    +    fi
    +    # if command is env, attempt to add more to the classpath
    +    if [ "$1" = "env" ]; then
    +        [ "x${TOOLS_JAR}" =  "x" ] && [ -n "${JAVA_HOME}" ] && 
TOOLS_JAR=$(find -H "${JAVA_HOME}" -name "tools.jar")
    +        [ "x${TOOLS_JAR}" =  "x" ] && [ -n "${JAVA_HOME}" ] && 
TOOLS_JAR=$(find -H "${JAVA_HOME}" -name "classes.jar")
    +        if [ "x${TOOLS_JAR}" =  "x" ]; then
    +             warn "Could not locate tools.jar or classes.jar. Please set 
manually to avail all command features."
    +        fi
    +    fi
    --- End diff --
    
    Is this block left over from the minifi.sh? I tried running it and got this:
    Joseph-Percivall:bin jpercivall$ ./config.sh env
    
    Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home
    MiNiFi Toolkit home: 
/Users/jpercivall/projects/edge/nifi-minifi/minifi-toolkit/minifi-toolkit-assembly/target/minifi-0.0.1-SNAPSHOT-bin/minifi-toolkit-0.0.1-SNAPSHOT
    
    
    Usage:
    
    java org.apache.nifi.minifi.toolkit.configuration.ConfigMain <command> 
options
    
    Valid commands include:
    transform: Transform template xml into MiNiFi config YAML
    validate: Validate config YAML



> Command Line Configuration Utility
> ----------------------------------
>
>                 Key: MINIFI-41
>                 URL: https://issues.apache.org/jira/browse/MINIFI-41
>             Project: Apache NiFi MiNiFi
>          Issue Type: New Feature
>            Reporter: Bryan Rosander
>
> It would really increase usability if we had a way to transform template xmls 
> into configuration YAML files for consumption by MiNiFi.
> The utility should:
> 1. Transform template xmls exported from NiFi into configuration YAML files.
> 2. Validate the contents of a given YAML file in the same way MiNiFi does at 
> runtime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to