summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonggangWang <wang.yonggang131@zte.com.cn>2017-04-18 14:28:09 +0800
committerYonggangWang <wang.yonggang131@zte.com.cn>2017-04-18 15:04:57 +0800
commit1b0fac8132c379acf3bf82d7b951ce9c0b25ba23 (patch)
treeca771f0375cd78b2a141ddc6f3eb1c98c0422e93
parent88117d09c52a6e6b3f5b299f90c8dbf0cf59d39a (diff)
Use openresty binary from OPEN-O Nexus to build
Issue-id: OCS-173 Modify Maven Scripts to Download openresty Binary from OPEN-O Nexus for MSB Building Change-Id: I1977253373f1fd063b2ae3827110bb77676dfd2f Signed-off-by: YonggangWang <wang.yonggang131@zte.com.cn>
-rw-r--r--msb-core/distributions/standalone/pom.xml30
-rw-r--r--msb-core/openresty-ext/pom.xml167
-rw-r--r--msb-core/openresty-ext/src/assembly/resources/openresty/nginx/logs/placeholder.txt0
-rw-r--r--msb-core/openresty-ext/src/assembly/resources/openresty/nginx/temp/placeholder.txt0
-rw-r--r--msb-core/openresty-ext/src/assembly/resources/openresty/run.sh8
-rw-r--r--msb-core/redis-ext/pom.xml1
6 files changed, 128 insertions, 78 deletions
diff --git a/msb-core/distributions/standalone/pom.xml b/msb-core/distributions/standalone/pom.xml
index 9a17d6e..f279928 100644
--- a/msb-core/distributions/standalone/pom.xml
+++ b/msb-core/distributions/standalone/pom.xml
@@ -55,31 +55,14 @@
<version>${project.version}</version>
<optional>true</optional>
</dependency>
-
- <dependency>
- <groupId>org.openo.common-services.microservice-bus</groupId>
- <artifactId>openresty</artifactId>
- <type>zip</type>
- <classifier>win64</classifier>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
<dependency>
<groupId>org.openo.common-services.microservice-bus</groupId>
- <artifactId>openresty</artifactId>
+ <artifactId>openresty-ext</artifactId>
<type>tar.gz</type>
<classifier>linux64</classifier>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
-
- <dependency>
- <groupId>org.openo.common-services.microservice-bus</groupId>
- <artifactId>openresty-ext</artifactId>
- <type>zip</type>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
<dependency>
<groupId>org.openo.common-services.microservice-bus</groupId>
<artifactId>eag-openresty-ext</artifactId>
@@ -169,15 +152,10 @@
</artifactItem>
<artifactItem>
<groupId>org.openo.common-services.microservice-bus</groupId>
- <artifactId>openresty</artifactId>
+ <artifactId>openresty-ext</artifactId>
<type>tar.gz</type>
<classifier>linux64</classifier>
</artifactItem>
- <artifactItem>
- <groupId>org.openo.common-services.microservice-bus</groupId>
- <artifactId>openresty-ext</artifactId>
- <type>zip</type>
- </artifactItem>
</artifactItems>
<excludes>**/*.bat,*.cmd</excludes>
<outputDirectory>${linux64outputdir}</outputDirectory>
@@ -195,9 +173,9 @@
<phase>prepare-package</phase>
<configuration>
<artifactItems>
- <artifactItem>
+ <artifactItem>
<groupId>org.openo.common-services.microservice-bus</groupId>
- <artifactId>openresty</artifactId>
+ <artifactId>openresty-ext</artifactId>
<type>tar.gz</type>
<classifier>linux64</classifier>
</artifactItem>
diff --git a/msb-core/openresty-ext/pom.xml b/msb-core/openresty-ext/pom.xml
index 904b95f..57a6af5 100644
--- a/msb-core/openresty-ext/pom.xml
+++ b/msb-core/openresty-ext/pom.xml
@@ -38,58 +38,125 @@
<packageid>openresty-ext</packageid>
</properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.openresty.centos.6</groupId>
+ <artifactId>openresty</artifactId>
+ <version>${openresty.version}</version>
+ <type>tar.gz</type>
+ </dependency>
+ </dependencies>
+
<build>
<plugins>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <configuration>
- <includeEmptyDirs>true</includeEmptyDirs>
- </configuration>
- <executions>
- <execution>
- <id>copy-resources</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${outputdir}</outputDirectory>
- <resources>
- <resource>
- <directory>src/assembly/resources/</directory>
- <filtering>false</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- </resources>
- <overwrite>true</overwrite>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution</id>
- <phase>package</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target name="distribution">
- <zip destfile="target/${packageid}-${project.version}.zip" update="true">
- <zipfileset dir="target/assembly/" includes="**"/>
- </zip>
- <attachartifact file="target/${packageid}-${project.version}.zip" type="zip"/>
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-dependency-file-linux</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <!--解压顺序,在最前面-->
+ <phase>generate-resources</phase>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.openresty.centos.6</groupId>
+ <artifactId>openresty</artifactId>
+ <type>tar.gz</type>
+ <outputDirectory>${linux64outputdir}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ <excludes>**/pod/**,**/*.pdb</excludes>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.coderplus.maven.plugins</groupId>
+ <artifactId>copy-rename-maven-plugin</artifactId>
+ <version>1.0.1</version>
+ <executions>
+ <execution>
+ <id>rename-nginx-dir</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>rename</goal>
+ </goals>
+ <configuration>
+ <sourceFile>${linux64outputdir}/openresty-${openresty.version}</sourceFile>
+ <destinationFile>${linux64outputdir}/openresty</destinationFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-msb-resources-linux64</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${linux64outputdir}</outputDirectory>
+ <includeEmptyDirs>true</includeEmptyDirs>
+ <resources>
+ <resource>
+ <directory>src/assembly/resources/</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.bat</exclude>
+ <exclude>**/openrestyService*</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <overwrite>true</overwrite>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>distribution-linux</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target name="distribution">
+ <tar destfile="${version.output}/${packageid}-${project.version}-${classifier.linux64}.tar.gz" longfile="posix" compression="gzip">
+ <tarfileset dir="${linux64outputdir}" filemode="0644" dirmode="0755">
+ <exclude name="**/*.sh"/>
+ <exclude name="openresty/nginx/sbin/nginx"/>
+ </tarfileset>
+ <tarfileset dir="${linux64outputdir}" filemode="0755" dirmode="0755">
+ <include name="**/*.sh"/>
+ <include name="openresty/nginx/sbin/nginx"/>
+ </tarfileset>
+ </tar>
+ <attachartifact file="${version.output}/${packageid}-${project.version}-${classifier.linux64}.tar.gz" classifier="${classifier.linux64}" type="tar.gz"/>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/logs/placeholder.txt b/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/logs/placeholder.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/logs/placeholder.txt
diff --git a/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/temp/placeholder.txt b/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/temp/placeholder.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/temp/placeholder.txt
diff --git a/msb-core/openresty-ext/src/assembly/resources/openresty/run.sh b/msb-core/openresty-ext/src/assembly/resources/openresty/run.sh
index cdf2d92..f5226b5 100644
--- a/msb-core/openresty-ext/src/assembly/resources/openresty/run.sh
+++ b/msb-core/openresty-ext/src/assembly/resources/openresty/run.sh
@@ -20,10 +20,16 @@
DIRNAME=`dirname $0`
HOME=`cd $DIRNAME/nginx; pwd`
+LUAJIT_HOME=`cd $DIRNAME/luajit; pwd`
_NGINXCMD="$HOME/sbin/nginx"
+echo =========== prepare the symbolic links ========================================
+ln -s -f $_NGINXCMD $DIRNAME/bin/openresty
+ln -s -f $LUAJIT_HOME/bin/luajit2.1.0-beta2 $LUAJIT_HOME/bin/luajit
+ln -s -f $LUAJIT_HOME/lib/libluajit-5.1.so.2.1.0 $LUAJIT_HOME/lib/libluajit-5.1.so.2
+ln -s -f $LUAJIT_HOME/lib/libluajit-5.1.so.2.1.0 $LUAJIT_HOME/lib/libluajit-5.1.so
+echo ================================================================================
echo =========== create symbolic link for libluajit-5.1.so.2 ========================================
-LUAJIT_HOME=`cd $DIRNAME/luajit; pwd`
LUAJIT_FILENAME="$LUAJIT_HOME/lib/libluajit-5.1.so.2"
LN_TARGET_FILE='/lib/libluajit-5.1.so.2'
LN_TARGET_FILE64='/lib64/libluajit-5.1.so.2'
diff --git a/msb-core/redis-ext/pom.xml b/msb-core/redis-ext/pom.xml
index 38e6e32..8161cf4 100644
--- a/msb-core/redis-ext/pom.xml
+++ b/msb-core/redis-ext/pom.xml
@@ -64,7 +64,6 @@
<artifactItem>
<groupId>org.redis.centos.7</groupId>
<artifactId>redis</artifactId>
- <version>${redis.version}</version>
<type>tar.gz</type>
<outputDirectory>${linux64outputdir}</outputDirectory>
</artifactItem>