You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/08/29 13:26:21 UTC

[plc4x] branch develop updated (99a1353 -> f2ab66d)

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

cdutz pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git.


    from 99a1353  Addition of single bit read from Integer files
     new 35f26a4  - Added the suppression of example deployments back
     new c7b93f5  - Made sure the *.RSA and *.SF files are excluded in the elasticsearch example
     new f2ab66d  - Added a dockerfile to build PLC4X with ALL features enabled

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .dockerignore                                      |  4 +
 Dockerfile                                         | 87 ++++++++++++++++++++++
 plc4j/examples/hello-storage-elasticsearch/pom.xml | 26 +++++++
 plc4j/examples/pom.xml                             | 13 ++++
 pom.xml                                            |  3 +
 5 files changed, 133 insertions(+)
 create mode 100644 .dockerignore
 create mode 100644 Dockerfile


[plc4x] 03/03: - Added a dockerfile to build PLC4X with ALL features enabled

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit f2ab66d5c284de2889c1e3b912375c7d304fe87a
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 29 15:26:15 2019 +0200

    - Added a dockerfile to build PLC4X with ALL features enabled
---
 .dockerignore |  4 +++
 Dockerfile    | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pom.xml       |  3 +++
 3 files changed, 94 insertions(+)

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..3fc9866
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,4 @@
+Dockerfile
+.dockerignore
+.git/**
+**/target/**
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..2c1e267
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,87 @@
+#  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.
+
+##########################################################################################
+# Build PLC4X
+##########################################################################################
+
+# This is the image we'll use to execute the build (and give it the name 'build').
+# (This image is based on Ubuntu)
+FROM azul/zulu-openjdk:latest as build
+
+# Install some stuff we need to run the build
+RUN apt update -y
+
+# Install general purpose tools
+RUN apt install -y make libpcap-dev libc-dev
+
+# Requied for "with-boost" profile
+RUN apt install -y bison flex gcc g++
+
+# Required for "with-cpp" profile
+RUN apt install -y gcc g++
+
+# Required for "with-dotnet" profile
+RUN apt install -y wget
+RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
+RUN dpkg -i packages-microsoft-prod.deb
+RUN apt install -y software-properties-common
+RUN add-apt-repository universe -y
+RUN apt install -y apt-transport-https
+RUN apt update -y
+RUN apt install -y dotnet-sdk-2.2
+
+# Required for "with-java" profile
+RUN apt install -y git
+
+# Required for "with-proxies"
+RUN apt install -y bison flex gcc g++
+
+# Required for "with-python" profile
+RUN apt install -y python-setuptools python
+
+# Copy the project into the docker container
+COPY . /ws/
+
+# Change the working directory (where commands are executed) into the new "ws" directory
+WORKDIR /ws
+
+# Tell Maven to fetch all needed dependencies first, so they can get cached
+# (Tried a patched version of the plugin to allow exclusion of inner artifacts.
+# See https://issues.apache.org/jira/browse/MDEP-568 for details)
+RUN ./mvnw -P with-java,with-cpp,with-boost,with-dotnet,with-python,with-proxies,with-sandbox com.offbytwo.maven.plugins:maven-dependency-plugin:3.1.1.MDEP568:go-offline -DexcludeGroupIds=org.apache.plc4x,org.apache.plc4x.examples,org.apache.plc4x.sandbox
+# Build everything with all tests
+RUN ./mvnw -P with-java,with-cpp,with-boost,with-dotnet,with-python,with-proxies,with-sandbox install
+
+#RUN ./mvnw -P with-java -DskipTests install
+
+# Get the version of the project and save it in a local file on the container
+RUN ./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -DforceStdout -q -pl . > project_version
+
+# Move the file to a place we can reference it from without a version
+RUN PROJECT_VERSION=`cat project_version`; mv plc4j/examples/hello-storage-elasticsearch/target/plc4j-hello-storage-elasticsearch-$PROJECT_VERSION-uber-jar.jar plc4xdemo.jar
+
+##########################################################################################
+# Build a demo container
+##########################################################################################
+
+# Now create an actuall deployment container
+FROM azul/zulu-openjdk:latest
+
+# Prepare the demo by copying the example artifact from the 'build' container into this new one.
+COPY --from=build /ws/plc4xdemo.jar /plc4xdemo.jar
+
+# This will be executed as soon as the container is started.
+ENTRYPOINT ["java", "-jar", "/plc4xdemo.jar"]
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index e48c26c..1ed3961 100644
--- a/pom.xml
+++ b/pom.xml
@@ -891,6 +891,9 @@
 
             <!-- Temporary Python virtualenv files-->
             <exclude>**/venv/**</exclude>
+
+            <!-- Exclude a temp file needed by Docker -->
+            <exclude>project_version</exclude>
           </excludes>
         </configuration>
       </plugin>


[plc4x] 01/03: - Added the suppression of example deployments back

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 35f26a4bab98edc529047b4e52a6959b91674e9f
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 29 15:25:00 2019 +0200

    - Added the suppression of example deployments back
---
 plc4j/examples/pom.xml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/plc4j/examples/pom.xml b/plc4j/examples/pom.xml
index c7e1aee..982e01c 100644
--- a/plc4j/examples/pom.xml
+++ b/plc4j/examples/pom.xml
@@ -84,6 +84,19 @@
         </executions>
       </plugin>
     </plugins>
+
+    <pluginManagement>
+      <plugins>
+        <!-- No need to deploy examples in a maven repo -->
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-deploy-plugin</artifactId>
+          <configuration>
+            <skip>true</skip>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
 
   <dependencyManagement>


[plc4x] 02/03: - Made sure the *.RSA and *.SF files are excluded in the elasticsearch example

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit c7b93f5663dc7ebe01fa77a48deea6f5a7841614
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 29 15:25:37 2019 +0200

    - Made sure the *.RSA and *.SF files are excluded in the elasticsearch example
---
 plc4j/examples/hello-storage-elasticsearch/pom.xml | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/plc4j/examples/hello-storage-elasticsearch/pom.xml b/plc4j/examples/hello-storage-elasticsearch/pom.xml
index a0df236..14ee733 100644
--- a/plc4j/examples/hello-storage-elasticsearch/pom.xml
+++ b/plc4j/examples/hello-storage-elasticsearch/pom.xml
@@ -110,6 +110,32 @@
 
   <build>
     <plugins>
+      <!-- Filter out some resources -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <id>generate-uber-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration combine.children="append">
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.RSA</exclude>
+                    <exclude>META-INF/*.SF</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>