Update to released
[policy/docker.git] / vagrant / setup_policy.sh
1 #!/usr/bin/env bash
2 # Copyright 2018 AT&T Intellectual Property. All rights reserved
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 set -ex
17
18 sudo apt-get update -y
19 sudo apt-get install -y maven openjdk-8-jdk npm python-pip docker.io
20 sudo pip install docker-compose
21
22 git clone http://gerrit.onap.org/r/oparent
23 mkdir $HOME/.m2
24 cp oparent/settings.xml $HOME/.m2
25
26 for comp in common drools-pdp drools-applications engine
27 do
28     cd $HOME
29     git clone http://gerrit.onap.org/r/policy/$comp
30     cd $comp
31     mvn clean install
32 done
33
34 for comp in policy-pe policy-drools
35 do
36     cd $HOME/$comp
37     sudo docker build -t onap/$comp packages/docker/target/$comp 
38 done
39
40 cd $HOME
41 git clone http://gerrit.onap.org/r/policy/docker
42 cd docker
43
44 cd $HOME/docker
45 chmod +x config/drools/drools-tweaks.sh
46 echo 192.168.0.10 > config/pe/ip_addr.txt
47 export MTU=1500
48 sudo -E docker-compose up -d