You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by kd...@apache.org on 2019/02/14 17:24:22 UTC

[nifi-registry] branch master updated: NIFIREG-226: Bugfix overriding flow provider in Docker container via environment variables

This is an automated email from the ASF dual-hosted git repository.

kdoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-registry.git


The following commit(s) were added to refs/heads/master by this push:
     new 1dcf960  NIFIREG-226: Bugfix overriding flow provider in Docker container via environment variables
1dcf960 is described below

commit 1dcf960606ae72e18d7b17d5b60bdb2a86eeb8c3
Author: Justin Gondron <jg...@nd.edu>
AuthorDate: Fri Dec 14 15:21:12 2018 -0500

    NIFIREG-226: Bugfix overriding flow provider in Docker container via environment variables
    
    The script which maps env to flow provider properties is currently not overwriting the file, but instead sending to stdout.
    This should fix the issue in the Docker update_flow_provider script.
    
    Note: This replicates a fix also made in pull requests #132 and #150 on github.
    
    This closes #152.
    This closes #150.
    This closes #132.
    
    Co-authored-by: Joao C Costa <jo...@users.noreply.github.com>
    Co-authored-by: silver2k <co...@findlay.geek.nz>
    Signed-off-by: Kevin Doran <kd...@apache.org>
---
 .../nifi-registry-docker/dockerhub/sh/update_flow_provider.sh       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/nifi-registry-core/nifi-registry-docker/dockerhub/sh/update_flow_provider.sh b/nifi-registry-core/nifi-registry-docker/dockerhub/sh/update_flow_provider.sh
index 79afc91..c903323 100644
--- a/nifi-registry-core/nifi-registry-docker/dockerhub/sh/update_flow_provider.sh
+++ b/nifi-registry-core/nifi-registry-docker/dockerhub/sh/update_flow_provider.sh
@@ -23,7 +23,9 @@ add_property() {
   property_value=$2
 
   if [ -n "${property_value}" ]; then
-    xmlstarlet ed --subnode "/providers/flowPersistenceProvider" --type elem -n property -v "${property_value}" providers.xml | xmlstarlet ed --subnode "/providers/flowPersistenceProvider/property[not(name)]" --type attr -n name -v "${property_name}"
+    xmlstarlet ed --inplace --subnode "${property_xpath}" --type elem -n property -v "${property_value}" \
+      -i \$prev --type attr -n name -v "${property_name}" \
+      "${providers_file}"
   fi
 }
 
@@ -39,4 +41,4 @@ case ${NIFI_REGISTRY_FLOW_PROVIDER} in
         add_property "Remote Access User"  "${NIFI_REGISTRY_GIT_USER:-}"
         add_property "Remote Access Password"    "${NIFI_REGISTRY_GIT_PASSWORD:-}"
         ;;
-esac
\ No newline at end of file
+esac