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

jermy pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ee7490  feat: add hubble dockerfile (#295)
3ee7490 is described below

commit 3ee7490baff7b2c48c7c8b18609bfacdae1d05df
Author: Simon Cheung <[email protected]>
AuthorDate: Fri Jul 22 17:57:05 2022 +0800

    feat: add hubble dockerfile (#295)
---
 hugegraph-dist/pom.xml                             |  4 +-
 hugegraph-hubble/Dockerfile                        | 19 ++++++
 .../assembly/travis/install-hugegraph-hubble.sh    |  4 +-
 hugegraph-hubble/hubble-dist/pom.xml               | 67 ++++++++++++++++++++--
 pom.xml                                            |  6 ++
 5 files changed, 92 insertions(+), 8 deletions(-)

diff --git a/hugegraph-dist/pom.xml b/hugegraph-dist/pom.xml
index 6f7a268..c29e5c7 100644
--- a/hugegraph-dist/pom.xml
+++ b/hugegraph-dist/pom.xml
@@ -34,12 +34,12 @@
                                     ls 
${project.parent.basedir}/hugegraph-loader/*
                                     ls 
${project.parent.basedir}/hugegraph-tools/*
 
-                                    \cp -r 
${project.parent.basedir}/hugegraph-hubble/hugegraph-hubble-${project.version} 
${project.basedir}
+                                    \cp -r 
${project.parent.basedir}/hugegraph-hubble/hugegraph-hubble ${project.basedir}
                                     \cp -r 
${project.parent.basedir}/hugegraph-loader/hugegraph-loader-${project.version} 
${project.basedir}
                                     \cp -r 
${project.parent.basedir}/hugegraph-tools/hugegraph-tools-${project.version} 
${project.basedir}
 
                                     tar -zcvf 
${project.parent.basedir}/${final.name}.tar.gz \
-                                    hugegraph-hubble-* hugegraph-loader-* 
hugegraph-tools-* || exit 1
+                                    hugegraph-hubble hugegraph-loader-* 
hugegraph-tools-* || exit 1
 
                                     md5sum 
${project.parent.basedir}/${final.name}.tar.gz
                                     echo -n "hugegraph-toolchain tar.gz 
available at: "
diff --git a/hugegraph-hubble/Dockerfile b/hugegraph-hubble/Dockerfile
new file mode 100644
index 0000000..af3430d
--- /dev/null
+++ b/hugegraph-hubble/Dockerfile
@@ -0,0 +1,19 @@
+FROM ubuntu:xenial
+
+RUN set -x \
+    && apt-get -q update \
+    && apt-get -q install -y --no-install-recommends --no-install-suggests \
+       curl \
+       lsof \
+       g++ \
+       gcc \
+       openjdk-8-jdk \
+    && apt-get clean
+
+ENV HUBBLE_HOME /opt/hugegraph-hubble
+WORKDIR ${HUBBLE_HOME}
+
+COPY ./hugegraph-hubble $HUBBLE_HOME
+EXPOSE 8088
+
+ENTRYPOINT ["./bin/start-hubble.sh"]
diff --git 
a/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh 
b/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh
index c107233..c004a24 100755
--- a/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh
+++ b/hugegraph-hubble/hubble-dist/assembly/travis/install-hugegraph-hubble.sh
@@ -3,7 +3,7 @@
 set -ev
 
 TRAVIS_DIR=$(dirname "$0")
-HUBBLE_DIR="hugegraph-hubble-*.*"
+HUBBLE_DIR="hugegraph-hubble"
 
 echo "$TRAVIS_DIR"
 pwd && mvn -e -X clean package -DskipTests
@@ -11,4 +11,4 @@ pwd && mvn -e -X clean package -DskipTests
 cp "${TRAVIS_DIR}"/jacocoagent.jar $HUBBLE_DIR/lib || exit 1
 cp "${TRAVIS_DIR}"/start-hubble.sh $HUBBLE_DIR/bin || exit 1
 
-./hugegraph-hubble-*/bin/start-hubble.sh
+${HUBBLE_DIR}/bin/start-hubble.sh
diff --git a/hugegraph-hubble/hubble-dist/pom.xml 
b/hugegraph-hubble/hubble-dist/pom.xml
index bb5fda3..8de7885 100644
--- a/hugegraph-hubble/hubble-dist/pom.xml
+++ b/hugegraph-hubble/hubble-dist/pom.xml
@@ -48,7 +48,7 @@
                             <appendAssemblyId>false</appendAssemblyId>
                             <outputDirectory>${top.level.dir}</outputDirectory>
                             
<descriptor>${assembly.descriptor.dir}/assembly.xml</descriptor>
-                            <finalName>${final.name}</finalName>
+                            <finalName>${release.name}</finalName>
                         </configuration>
                     </execution>
                 </executions>
@@ -70,10 +70,11 @@
                                     echo -e "Hubble-FE build successfully.\n"
 
                                     cd ${top.level.dir} &amp;&amp; pwd
-                                    rm -rf ${final.name}/ui
-                                    cp -r ${hubble-fe.dir}/build 
${final.name}/ui
+                                    rm -rf ${release.name}/ui
+                                    cp -r ${hubble-fe.dir}/build 
${release.name}/ui
 
-                                    tar -zcvf 
${top.level.dir}/${final.name}.tar.gz ${final.name} || exit 1
+                                    tar -zcvf 
${top.level.dir}/${final.name}.tar.gz ${release.name} || exit 1
+                                    cp -r ${release.name} ./hubble-dist
                                     echo -n "hugegraph-hubble tar.gz available 
at: "
                                     echo 
"${top.level.dir}/${final.name}.tar.gz"
                                     rm -f ${top.level.dir}/dist.sh
@@ -105,6 +106,64 @@
                     </filesets>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>${exec-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>docker-build</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                            <skip>${docker.build.skip}</skip>
+                            <executable>docker</executable>
+                            
<workingDirectory>${project.basedir}</workingDirectory>
+                            <arguments>
+                                <argument>build</argument>
+                                <argument>--no-cache</argument>
+                                <argument>-t</argument>
+                                
<argument>${docker.hub}/${parent.artifactId}:${docker.tag}</argument>
+                                <argument>-t</argument>
+                                
<argument>${docker.hub}/${parent.artifactId}:latest</argument>
+                                <argument>${project.basedir}</argument>
+                                <argument>--file=../Dockerfile</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>docker-push</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <configuration>
+                            <skip>${docker.push.skip}</skip>
+                            <environmentVariables>
+                                <DOCKER_BUILDKIT>1</DOCKER_BUILDKIT>
+                            </environmentVariables>
+                            <executable>docker</executable>
+                            
<workingDirectory>${project.basedir}</workingDirectory>
+                            <arguments>
+                                <argument>buildx</argument>
+                                <argument>build</argument>
+                                <argument>--platform</argument>
+                                <argument>linux/amd64,linux/arm64</argument>
+                                <argument>--no-cache</argument>
+                                <argument>--push</argument>
+                                <argument>-t</argument>
+                                
<argument>${docker.hub}/${parent.artifactId}:${docker.tag}</argument>
+                                <argument>-t</argument>
+                                
<argument>${docker.hub}/${parent.artifactId}:latest</argument>
+                                <argument>${project.basedir}</argument>
+                                <argument>--file=../Dockerfile</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/pom.xml b/pom.xml
index 0437b4d..d0c37e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,12 @@
         <flinkcdc.version>2.2.1</flinkcdc.version>
         <spark.version>3.1.2</spark.version>
         <scala.version>2.12</scala.version>
+        <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
+        <docker.build.skip>true</docker.build.skip>
+        <docker.push.skip>true</docker.push.skip>
+        <docker.hub>hugegraph</docker.hub>
+        <docker.repo>${project.name}</docker.repo>
+        <docker.tag>${project.version}</docker.tag>
     </properties>
 
     <dependencies>

Reply via email to