Fix: Rename the config folders inside dmm/stacks.
[dmm.git] / demo / nginx_proxy / demo-2 / setup_proxy.sh
1 #########################################################################
2 # Copyright (c) 2018 Huawei Technologies Co.,Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #########################################################################
15 #!/bin/bash -x
16
17 set -x
18 sudo su
19 # Clean up build NGINX
20 cd /DMM/build/
21
22 #Download and compile NGINX
23 make NGINX
24 #Download and compile vpp-stack
25 make vpp-stack
26
27 #cp vpp libs
28 cp -r /DMM/stacks/vpp/vpp/build-root/install-vpp_debug-native/vpp/lib64/vpp_plugins /usr/lib/
29 mkdir -p /etc/vpp/
30 cp /DMM/demo/nginx_proxy/demo-2/startup.conf /etc/vpp/
31 cp /DMM/demo/nginx_proxy/demo-2/vpp_config /etc/vpp/
32 cd /DMM/stacks/vpp/vpp/build-root/install-vpp_debug-native/vpp/bin
33 #run vpp
34 sudo ifconfig enp0s9 down
35 ./vpp -c /etc/vpp/startup.conf
36
37 #cp nginx libs
38 cd /DMM/thirdparty/apps/nginx/release
39
40 # Move the conf file.
41 cp /DMM/demo/nginx_proxy/demo-2/module_config.json /DMM/thirdparty/apps/nginx/release/
42 cp /DMM/stacks/lwip_stack/configure/nStackConfig.json /DMM/thirdparty/apps/nginx/release/
43 cp /DMM/demo/nginx_proxy/demo-2/proxy_nginx.conf /DMM/thirdparty/apps/nginx/release/
44 cp /DMM/demo/nginx_proxy/demo-2/rd_config.json /DMM/thirdparty/apps/nginx/release/
45 mv /DMM/thirdparty/apps/nginx/release/proxy_nginx.conf /DMM/thirdparty/apps/nginx/release/nginx.conf
46
47 sleep 5
48
49 # Run nginx
50 cp /DMM/stacks/vpp/vpp/build-root/install-vpp_debug-native/vpp/lib64/libdmm_vcl.so /DMM/thirdparty/apps/nginx/release/
51 echo "export LD_LIBRARY_PATH=/DMM/stacks/lwip_stack/release/lib64"
52 echo "./nginx"
53
54 exit 0