aboutsummaryrefslogtreecommitdiffstats
path: root/msb-core/distributions/standalone/src
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2016-08-17 12:37:07 +0800
committerHuabingZhao <zhao.huabing@zte.com.cn>2016-08-17 14:03:37 +0800
commit4143173cd08ef515173e5ad4b4c15d4e9f9f1943 (patch)
tree0aa7a7ae64ce9876b95628cb5835ff5e12c8a546 /msb-core/distributions/standalone/src
parent230628860edf5ff489dd59e299d35c80d1329a5d (diff)
1. Adjust the directory hierarchy
2. Fix the compile issue Change-Id: Ibf10c83104e5e673bc797013799861426cd950ce Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'msb-core/distributions/standalone/src')
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/servicesInstall.bat34
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/servicesRestart.bat34
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/servicesStatus.bat34
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/servicesUninstall.bat37
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/shutdown.bat37
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/shutdown.sh39
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/startup.bat39
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/startup.sh45
-rw-r--r--msb-core/distributions/standalone/src/assembly/resource/startup4docker.sh33
-rw-r--r--msb-core/distributions/standalone/src/main/docker/Dockerfile5
10 files changed, 337 insertions, 0 deletions
diff --git a/msb-core/distributions/standalone/src/assembly/resource/servicesInstall.bat b/msb-core/distributions/standalone/src/assembly/resource/servicesInstall.bat
new file mode 100644
index 0000000..f7b3b24
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/servicesInstall.bat
@@ -0,0 +1,34 @@
+@REM
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+@echo off
+title msb install services
+
+set RUNHOME=%~dp0
+
+echo ### install redis
+cd "%RUNHOME%\redis"
+redisService.exe install
+
+echo ### install apiroute
+cd "%RUNHOME%\apiroute"
+apirouteService.exe install
+
+echo ### install openresty
+cd "%RUNHOME%\openresty\nginx"
+openrestyService.exe install
+
+:finalend
+cd "%RUNHOME%" \ No newline at end of file
diff --git a/msb-core/distributions/standalone/src/assembly/resource/servicesRestart.bat b/msb-core/distributions/standalone/src/assembly/resource/servicesRestart.bat
new file mode 100644
index 0000000..4b28af8
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/servicesRestart.bat
@@ -0,0 +1,34 @@
+@REM
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+@echo off
+title msb restart services
+
+set RUNHOME=%~dp0
+
+echo ### restart redis
+cd "%RUNHOME%\redis"
+redisService.exe restart
+
+echo ### restart apiroute
+cd "%RUNHOME%\apiroute"
+apirouteService.exe restart
+
+echo ### restart openresty
+cd "%RUNHOME%\openresty\nginx"
+openrestyService.exe restart
+
+:finalend
+cd "%RUNHOME%" \ No newline at end of file
diff --git a/msb-core/distributions/standalone/src/assembly/resource/servicesStatus.bat b/msb-core/distributions/standalone/src/assembly/resource/servicesStatus.bat
new file mode 100644
index 0000000..138fd03
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/servicesStatus.bat
@@ -0,0 +1,34 @@
+@REM
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+@echo off
+title msb status services
+
+set RUNHOME=%~dp0
+
+echo ### status redis
+cd "%RUNHOME%\redis"
+redisService.exe status
+
+echo ### status apiroute
+cd "%RUNHOME%\apiroute"
+apirouteService.exe status
+
+echo ### status openresty
+cd "%RUNHOME%\openresty\nginx"
+openrestyService.exe status
+
+:finalend
+cd "%RUNHOME%" \ No newline at end of file
diff --git a/msb-core/distributions/standalone/src/assembly/resource/servicesUninstall.bat b/msb-core/distributions/standalone/src/assembly/resource/servicesUninstall.bat
new file mode 100644
index 0000000..b1cd76e
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/servicesUninstall.bat
@@ -0,0 +1,37 @@
+@REM
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+@echo off
+title msb uninstall services
+
+set RUNHOME=%~dp0
+
+echo ### uninstall redis
+cd "%RUNHOME%\redis"
+redisService.exe stop
+redisService.exe uninstall
+
+echo ### uninstall apiroute
+cd "%RUNHOME%\apiroute"
+apirouteService.exe stop
+apirouteService.exe uninstall
+
+echo ### uninstall openresty
+cd "%RUNHOME%\openresty\nginx"
+openrestyService.exe stop
+openrestyService.exe uninstall
+
+:finalend
+cd "%RUNHOME%" \ No newline at end of file
diff --git a/msb-core/distributions/standalone/src/assembly/resource/shutdown.bat b/msb-core/distributions/standalone/src/assembly/resource/shutdown.bat
new file mode 100644
index 0000000..c304747
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/shutdown.bat
@@ -0,0 +1,37 @@
+@REM
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+@echo off
+title stopping msb
+
+set RUNHOME=%~dp0
+echo ##RUNHOME %RUNHOME%
+
+rem dir /B /S stop.bat > %~dp0\stop.tmp
+rem For /f %%i in (%~dp0\stop.tmp) DO start %%i
+
+echo ### Stopping openresty
+start /D %RUNHOME%openresty stop.bat
+
+echo ### Stopping apiroute
+start /D %RUNHOME%apiroute stop.bat
+
+echo ### Stopping redis
+start /D %RUNHOME%redis stop.bat
+
+echo "Closing signal has been sent!";
+echo "Stopping in background,wait for a moment";
+rem del stop.tmp
+:finalend \ No newline at end of file
diff --git a/msb-core/distributions/standalone/src/assembly/resource/shutdown.sh b/msb-core/distributions/standalone/src/assembly/resource/shutdown.sh
new file mode 100644
index 0000000..653eef4
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/shutdown.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# 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.
+#
+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/msb-core/distributions/standalone/src/assembly/resource/startup.bat b/msb-core/distributions/standalone/src/assembly/resource/startup.bat
new file mode 100644
index 0000000..7373d05
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/startup.bat
@@ -0,0 +1,39 @@
+@REM
+@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+@echo off
+title msb
+
+set RUNHOME=%~dp0
+echo ##RUNHOME %RUNHOME%
+
+rem dir /B /S run.bat > %~dp0\run.tmp
+rem For /f %%i in (%~dp0\run.tmp) DO start %%i
+
+echo ### Starting redis
+start /D %RUNHOME%redis run.bat
+
+echo ### Starting apiroute
+start /D %RUNHOME%apiroute run.bat run
+
+echo ### Starting openresty
+start /D %RUNHOME%openresty run.bat
+
+echo Startup will be finished in background...
+echo + Run "start .\apiroute-works\logs\application.log" to see what's happening
+echo + Wait a minute
+echo + Open "http://<HOST>" in your browser to access the microservice bus !
+rem del run.tmp
+:finalend \ No newline at end of file
diff --git a/msb-core/distributions/standalone/src/assembly/resource/startup.sh b/msb-core/distributions/standalone/src/assembly/resource/startup.sh
new file mode 100644
index 0000000..1d785ce
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/startup.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# 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.
+#
+DIRNAME=`dirname $0`
+RUNHOME=`cd $DIRNAME/; pwd`
+echo @RUNHOME@ $RUNHOME
+
+echo "### Starting redis";
+#nohup ./wso2bps/bin/wso2server.sh >>./OpenTOSCA/nohup.log 2>&1 &
+cd ./redis
+./run.sh &
+cd $RUNHOME
+
+
+echo "\n\n### Starting apiroute"
+cd ./apiroute
+./run.sh &
+cd $RUNHOME
+
+
+echo "### Starting openresty...";
+# nohup ./startup.sh >>./nohup.log 2>&1 &
+cd ./openresty
+./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";
diff --git a/msb-core/distributions/standalone/src/assembly/resource/startup4docker.sh b/msb-core/distributions/standalone/src/assembly/resource/startup4docker.sh
new file mode 100644
index 0000000..134f1fe
--- /dev/null
+++ b/msb-core/distributions/standalone/src/assembly/resource/startup4docker.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# 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.
+#
+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
diff --git a/msb-core/distributions/standalone/src/main/docker/Dockerfile b/msb-core/distributions/standalone/src/main/docker/Dockerfile
new file mode 100644
index 0000000..8023ff4
--- /dev/null
+++ b/msb-core/distributions/standalone/src/main/docker/Dockerfile
@@ -0,0 +1,5 @@
+FROM java:8-alpine
+ADD msb-standalone-1.0.0-SNAPSHOT-linux64.tar.gz /opt/application
+WORKDIR /opt/application
+EXPOSE 10080
+ENTRYPOINT exec $PWD/startup4docker.sh \ No newline at end of file