apiri commented on a change in pull request #511: Minificpp 764: Add docker 
builds for different systems.
URL: https://github.com/apache/nifi-minifi-cpp/pull/511#discussion_r265997488
 
 

 ##########
 File path: docker/ContainerBuild.sh
 ##########
 @@ -0,0 +1,63 @@
+# 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/bash
+
+# Set env vars.
+UID_ARG=$1
+GID_ARG=$2
+MINIFI_VERSION=$3
+MINIFI_SOURCE_CODE=$4
+CMAKE_SOURCE_DIR=$5
+DUMP_LOCATION=$6
+DISTRO_NAME=$7
+
+echo "NiFi-MiNiFi-CPP Version: $MINIFI_VERSION"
+echo "Current Working Directory: $(pwd)"
+echo "CMake Source Directory: $CMAKE_SOURCE_DIR"
+echo "MiNiFi Package: $MINIFI_SOURCE_CODE"
+
+# Copy the MiNiFi source tree to the Docker working directory before building
+mkdir -p $CMAKE_SOURCE_DIR/docker/${DISTRO_NAME}/minificppsource
+rsync -avr \
+      --exclude '/*build*' \
+      --exclude '/docker' \
+      --exclude '.git' \
+      --exclude '/extensions/expression-language/Parser.cpp' \
+      --exclude '/extensions/expression-language/Parser.hpp' \
+      --exclude '/extensions/expression-language/Scanner.cpp' \
+      --exclude '/extensions/expression-language/location.hh' \
+      --exclude '/extensions/expression-language/position.hh' \
+      --exclude '/extensions/expression-language/stack.hh' \
+      --delete \
+      $CMAKE_SOURCE_DIR/ \
+      $CMAKE_SOURCE_DIR/docker/${DISTRO_NAME}/minificppsource/
+
+DOCKER_COMMAND="docker build --build-arg UID=$UID_ARG \
+                             --build-arg GID=$GID_ARG \
+                             --build-arg MINIFI_VERSION=$MINIFI_VERSION \
+                             --build-arg 
MINIFI_SOURCE_CODE=$MINIFI_SOURCE_CODE \
+                             --build-arg DUMP_LOCATION=$DUMP_LOCATION \
+                             -t \
+                             apacheminificpp:${DISTRO_NAME}-$MINIFI_VERSION ."
+echo "Docker Command: '$DOCKER_COMMAND'"
+${DOCKER_COMMAND}
+
+docker run --rm --entrypoint cat 
apacheminificpp:${DISTRO_NAME}-$MINIFI_VERSION 
/opt/minifi/build/nifi-minifi-cpp-$MINIFI_VERSION-bin.tar.gz > 
${DUMP_LOCATION}/nifi-minifi-cpp-${DISTRO_NAME}-$MINIFI_VERSION-bin.tar.gz
 
 Review comment:
   Might be handy to allow an optional maven repository to be specified and 
then we provide that here as a volume when we run.  Would save the need to 
download all the artifacts repeatedly when doing the JNI bits. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to