aboutsummaryrefslogtreecommitdiffstats
path: root/distributions
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2017-07-25 15:18:33 +0800
committerHuabingZhao <zhao.huabing@zte.com.cn>2017-07-25 18:11:59 +0800
commit672f3d40be83d9e380fd7be4b674d5e8d5fa36de (patch)
tree43105e1d5e2ba8e8accea8648e57e1cf87db3f00 /distributions
parent41d3db15a8e1a0496f9c2a5e15db2998a32bb9bf (diff)
Divide the MSB source codes into two repos
Change-Id: Ie76d545b214a8ce5191f215350a623e1529983d9 Issue-id: MSB-5 Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'distributions')
-rw-r--r--distributions/msb-apigateway/pom.xml191
-rw-r--r--distributions/msb-apigateway/src/assembly/resources/shutdown.sh41
-rw-r--r--distributions/msb-apigateway/src/assembly/resources/startup.sh44
-rw-r--r--distributions/msb-apigateway/src/assembly/resources/startup4docker.sh36
-rw-r--r--distributions/msb-apigateway/src/main/docker/Dockerfile6
-rw-r--r--distributions/pom.xml27
6 files changed, 345 insertions, 0 deletions
diff --git a/distributions/msb-apigateway/pom.xml b/distributions/msb-apigateway/pom.xml
new file mode 100644
index 0000000..0cb4239
--- /dev/null
+++ b/distributions/msb-apigateway/pom.xml
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.onap.msb.apigateway.distributions</groupId>
+ <artifactId>distributions-parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.onap.msb.apigateway.distributions</groupId>
+ <artifactId>msb-apigateway</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>onap/msb/apigateway/distributions/msb-apigateway</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <packageid>msb-apigateway</packageid>
+ <version.output>target/version</version.output>
+ </properties>
+
+ <profiles>
+ <profile>
+ <id>linux</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.msb.apigateway.apiroute</groupId>
+ <artifactId>apiroute-standalone</artifactId>
+ <type>zip</type>
+ <version>${project.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.onap.msb.apigateway</groupId>
+ <artifactId>redis-ext</artifactId>
+ <type>tar.gz</type>
+ <classifier>${classifier.linux64}</classifier>
+ <version>${project.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onap.msb.apigateway</groupId>
+ <artifactId>openresty-ext</artifactId>
+ <type>tar.gz</type>
+ <classifier>${classifier.linux64}</classifier>
+ <version>${project.version}</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpacktolinux64</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.onap.msb.apigateway.apiroute</groupId>
+ <artifactId>apiroute-standalone</artifactId>
+ <type>zip</type>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.onap.msb.apigateway</groupId>
+ <artifactId>redis-ext</artifactId>
+ <type>tar.gz</type>
+ <classifier>${classifier.linux64}</classifier>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.onap.msb.apigateway</groupId>
+ <artifactId>openresty-ext</artifactId>
+ <type>tar.gz</type>
+ <classifier>${classifier.linux64}</classifier>
+ </artifactItem>
+ </artifactItems>
+ <excludes>**/*.bat,**/*.cmd,**/*.exe</excludes>
+ <outputDirectory>${linux64outputdir}</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-msb-resources-linux</id>
+ <phase>prepare-package</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>
+ </excludes>
+ </resource>
+ </resources>
+ <overwrite>true</overwrite>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-resources-dockerfile</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${version.output}</outputDirectory>
+ <includeEmptyDirs>true</includeEmptyDirs>
+ <resources>
+ <resource>
+ <directory>${dockerFileDir}</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">
+
+ <tstamp>
+ <format property="last.updated" pattern="yyyy-MM-dd HH:mm:ss"/>
+ </tstamp>
+ <echo file="${linux64outputdir}/msb.version.properties" message="build.time=${last.updated}${line.separator}build.version=${project.version}"/>
+ <tar destfile="${version.output}/${packageid}-${project.version}-${classifier.linux64}.tar.gz" longfile="posix" compression="gzip">
+ <tarfileset dir="${linux64outputdir}" prefix="${packageid}" filemode="0644" dirmode="0755">
+ <exclude name="**/*.sh"/>
+ <exclude name="openresty/nginx/sbin/nginx"/>
+ <exclude name="redis/redis-*"/>
+ </tarfileset>
+ <tarfileset dir="${linux64outputdir}" prefix="${packageid}" filemode="0755" dirmode="0755">
+ <include name="**/*.sh"/>
+ <include name="openresty/nginx/sbin/nginx"/>
+ <include name="redis/redis-*"/>
+ </tarfileset>
+ </tar>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+</project>
+
diff --git a/distributions/msb-apigateway/src/assembly/resources/shutdown.sh b/distributions/msb-apigateway/src/assembly/resources/shutdown.sh
new file mode 100644
index 0000000..b36bb43
--- /dev/null
+++ b/distributions/msb-apigateway/src/assembly/resources/shutdown.sh
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+#
+# Licensed 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.
+#
+
+#!/bin/sh
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+
+echo "### Stopping openresty...";
+# nohup ./startup.sh >>./nohup.log 2>&1 &
+cd ./openresty
+./stop.sh &
+cd $RUNHOME
+
+echo "\n\n### Stopping apiroute"
+cd ./apiroute
+./stop.sh &
+cd $RUNHOME
+
+echo "### Stopping redis";
+cd ./redis
+./stop.sh &
+cd $RUNHOME
+
+echo "Closing signal has been sent!";
+echo "Stopping in background,wait for a moment";
+sleep 3; \ No newline at end of file
diff --git a/distributions/msb-apigateway/src/assembly/resources/startup.sh b/distributions/msb-apigateway/src/assembly/resources/startup.sh
new file mode 100644
index 0000000..5a19128
--- /dev/null
+++ b/distributions/msb-apigateway/src/assembly/resources/startup.sh
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+#
+# Licensed 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.
+#
+
+
+#!/bin/sh
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+echo "### Starting redis";
+cd ./redis
+./run.sh &
+cd $RUNHOME
+
+echo "### Starting openresty...";
+# nohup ./startup.sh >>./nohup.log 2>&1 &
+cd ./openresty
+./run.sh &
+cd $RUNHOME
+
+echo "\n\n### Starting apiroute"
+cd ./apiroute
+./run.sh
+cd $RUNHOME
+
+
+echo "Startup will be finished in background...";
+echo " + Run 'tail ./apiroute-works/logs/application.log -f' to see what's happening";
+echo " + Wait a minute";
+echo " + Open 'http://<HOST>' in your browser to access the microservice bus
+stem"; \ No newline at end of file
diff --git a/distributions/msb-apigateway/src/assembly/resources/startup4docker.sh b/distributions/msb-apigateway/src/assembly/resources/startup4docker.sh
new file mode 100644
index 0000000..b1dcb78
--- /dev/null
+++ b/distributions/msb-apigateway/src/assembly/resources/startup4docker.sh
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+#
+# Licensed 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.
+#
+
+#!/bin/sh
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+
+
+echo "### Starting redis";
+cd ./redis
+./run.sh
+cd $RUNHOME
+
+echo "\n\n### Starting openresty";
+cd ./openresty
+./run.sh
+cd $RUNHOME
+
+echo "\n\n### Starting apiroute"
+cd ./apiroute
+./run.sh \ No newline at end of file
diff --git a/distributions/msb-apigateway/src/main/docker/Dockerfile b/distributions/msb-apigateway/src/main/docker/Dockerfile
new file mode 100644
index 0000000..14e0b15
--- /dev/null
+++ b/distributions/msb-apigateway/src/main/docker/Dockerfile
@@ -0,0 +1,6 @@
+FROM openjdk:8.0.72
+ADD msb-apigateway*.tar.gz /opt/application
+
+ENV LD_LIBRARY_PATH /lib64
+WORKDIR /opt/application/msb-apigateway
+ENTRYPOINT exec $PWD/startup4docker.sh \ No newline at end of file
diff --git a/distributions/pom.xml b/distributions/pom.xml
new file mode 100644
index 0000000..90a70b3
--- /dev/null
+++ b/distributions/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.msb.apigateway</groupId>
+ <artifactId>msb-apigateway-parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.onap.msb.apigateway.distributions</groupId>
+ <artifactId>distributions-parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>onap/msb/apigateway/distributions</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>msb-apigateway</module>
+ </modules>
+
+
+ <properties>
+ <version.output>target/version</version.output>
+ <dockerFileDir>src/main/docker</dockerFileDir>
+ <blueprintFileDir>src/main/blueprint</blueprintFileDir>
+ </properties>
+
+</project>
+