This is an automated email from the ASF dual-hosted git repository.
wenjun pushed a commit to branch 3.2.2-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/3.2.2-prepare by this push:
new e524cfe744 [Improvement-16125][dolphinscheduler-dist] Reduce binary
distribution tarball file size (#16192)
e524cfe744 is described below
commit e524cfe744e02c111e372e1255865ebee2de0278
Author: zhuxt2015 <[email protected]>
AuthorDate: Mon Jun 24 21:50:18 2024 +0800
[Improvement-16125][dolphinscheduler-dist] Reduce binary distribution
tarball file size (#16192)
---
dolphinscheduler-dist/pom.xml | 20 +++++++
.../src/main/assembly/create-symlinks.sh | 63 ++++++++++++++++++++++
2 files changed, 83 insertions(+)
diff --git a/dolphinscheduler-dist/pom.xml b/dolphinscheduler-dist/pom.xml
index ee4c85589e..cdd7c124b4 100644
--- a/dolphinscheduler-dist/pom.xml
+++ b/dolphinscheduler-dist/pom.xml
@@ -118,6 +118,26 @@
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>${exec-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>docker-build</id>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <executable>sh</executable>
+ <arguments>
+
<argument>${basedir}/../dolphinscheduler-dist/src/main/assembly/create-symlinks.sh</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
diff --git a/dolphinscheduler-dist/src/main/assembly/create-symlinks.sh
b/dolphinscheduler-dist/src/main/assembly/create-symlinks.sh
new file mode 100644
index 0000000000..09bc5ba7ea
--- /dev/null
+++ b/dolphinscheduler-dist/src/main/assembly/create-symlinks.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+#
+# 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.
+#
+
+set -eu
+script_dir=`dirname $0`
+cd $script_dir/../../../target
+# Check if the package file exists
+if ! ls ./apache-dolphinscheduler-*-bin.tar.gz &> /dev/null; then
+ echo "File apache-dolphinscheduler-*-bin.tar.gz not found"
+ exit 0
+fi
+package_file=$(ls apache-dolphinscheduler-*-bin.tar.gz)
+echo $package_file
+
+decompress_dirname="${package_file%.tar.gz}"
+rm -rf $decompress_dirname
+#Decompress package file
+tar -xf $package_file
+cd $decompress_dirname
+
+SHARED_LIB_DIR="libs"
+# create share lib directory
+mkdir -p $SHARED_LIB_DIR
+
+echo 'iterate through the lib directory for all subprojects'
+for module in api-server master-server worker-server alert-server tools; do
+ MODULE_LIB_DIR="$module/libs"
+ echo "handling $MODULE_LIB_DIR"
+
+ if [ -d "$MODULE_LIB_DIR" ]; then
+ cd $MODULE_LIB_DIR
+
+ for jar in *.jar; do
+ # Move jar file to share lib directory
+ mv $jar ../../$SHARED_LIB_DIR/
+
+ # Create a symbolic link in the subproject's lib directory
+ ln -s ../../$SHARED_LIB_DIR/$jar .
+ done
+
+ cd - > /dev/null
+ fi
+done
+
+#Recompress the package
+cd ..
+tar -zcf $package_file $decompress_dirname
+rm -rf $decompress_dirname
\ No newline at end of file