Use openresty binary from OPEN-O Nexus to build
authorYonggangWang <wang.yonggang131@zte.com.cn>
Tue, 18 Apr 2017 06:28:09 +0000 (14:28 +0800)
committerYonggangWang <wang.yonggang131@zte.com.cn>
Tue, 18 Apr 2017 07:04:57 +0000 (15:04 +0800)
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>
msb-core/distributions/standalone/pom.xml
msb-core/openresty-ext/pom.xml
msb-core/openresty-ext/src/assembly/resources/openresty/nginx/logs/placeholder.txt [new file with mode: 0644]
msb-core/openresty-ext/src/assembly/resources/openresty/nginx/temp/placeholder.txt [new file with mode: 0644]
msb-core/openresty-ext/src/assembly/resources/openresty/run.sh
msb-core/redis-ext/pom.xml

index 9a17d6e..f279928 100644 (file)
         <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>
                   </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>
             <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>
index 904b95f..57a6af5 100644 (file)
       <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 (file)
index 0000000..e69de29
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 (file)
index 0000000..e69de29
index cdf2d92..f5226b5 100644 (file)
 
 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'
index 38e6e32..8161cf4 100644 (file)
@@ -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>