592f8064380382b663d7d69552b91e803639a376
[ric-plt/submgr.git] / build / binary / compile.sh
1 #!/bin/sh -e
2 #
3 #==================================================================================
4 #   Copyright (c) 2019 AT&T Intellectual Property.
5 #   Copyright (c) 2019 Nokia
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18 #==================================================================================
19 #
20 #
21 #       Mnemonic:       compile.sh
22 #       Abstract:       Compiles the source of Subscription Manager service and the two platform component stubs
23 #       Date:           28 May 2019
24 #
25 echo "PULLING RMR"
26 cd /opt
27 git clone "https://gerrit.o-ran-sc.org/r/ric-plt/lib/rmr"
28 echo "START COMPILING RMR"
29 cd /opt/rmr
30 git checkout v1.0.31
31 mkdir -p build
32 cd build
33 cmake ..
34 make install
35
36 echo "PULLING LOG"
37 cd /opt
38 git clone "https://gerrit.o-ran-sc.org/r/com/log"
39 echo "START COMPILING LOG"
40 cd /opt/log
41 ./autogen.sh
42 ./configure
43 make install
44
45 ldconfig
46
47 echo "DOWNLOAD GO DEPENDENCIES"
48 cd /opt/
49 mkdir -p /opt/bin
50 go get
51
52 echo "START COMPILING COMPONENTS"
53 go build -o /opt/bin/submgr ./cmd/submgr.go
54 go build -o /opt/test/rco/rco ./test/rco/rco.go
55 go build -o /opt/test/e2t/e2t ./test/e2t/e2t.go
56
57 echo "SAVE RESULT"
58 mkdir -p /opt/build/container/usr/local /opt/test/e2t/container/usr/local /opt/test/rco/container/usr/local
59 cp -Rf /usr/local/lib /usr/local/include /opt/build/container/usr/local/
60 cp -Rf /usr/local/lib /usr/local/include  /opt/test/e2t/container/usr/local/
61 cp -Rf /usr/local/lib /usr/local/include  /opt/test/rco/container/usr/local/
62 cp bin/submgr config/submgr.yaml /opt/build/container/
63
64 echo "CLEANUP"
65 rm -Rf /opt/rmr /opt/log /opt/go.sum
66
67 echo "DONE"