54bb9a47727eccb610d061dca331bc3e411da620
[ci-management.git] / jjb / ric-plt-dbaas / setup-dbaas-build-deb.sh
1 #!/bin/bash\r
2 ##############################################################################\r
3 #\r
4 #   Copyright (c) 2020 AT&T Intellectual Property.\r
5 #   Copyright (c) 2020 Nokia.\r
6 #   Copyright (c) 2020 HCL Technologies\r
7 #\r
8 #   Licensed under the Apache License, Version 2.0 (the "License");\r
9 #   you may not use this file except in compliance with the License.\r
10 #   You may obtain a copy of the License at\r
11 #\r
12 #       http://www.apache.org/licenses/LICENSE-2.0\r
13 #\r
14 #   Unless required by applicable law or agreed to in writing, software\r
15 #   distributed under the License is distributed on an "AS IS" BASIS,\r
16 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17 #   See the License for the specific language governing permissions and\r
18 #   limitations under the License.\r
19 #\r
20 ##############################################################################\r
21 \r
22 # Installs prerequisites needed to compile & test SDL code\r
23 # and build RPM/DEB packages on a Debian/Ubuntu machine.\r
24 \r
25 echo "--> setup-dbaas-build-deb.sh"\r
26 \r
27 # Ensure we fail the job if any steps fail.\r
28 set -eux -o pipefail\r
29 \r
30 # NOTE: The valgrind false positive problem could also potentially be solved\r
31 # with valgrind suppression files but that kind of approach may be fragile.\r
32 \r
33 # install prereqs\r
34 sudo apt-get update && sudo apt-get -q -y install \\r
35    automake \\r
36     autoconf \\r
37     cmake \\r
38     curl \\r
39     g++ \\r
40     gcc \\r
41     libtool \\r
42     make \\r
43     pkg-config \\r
44     valgrind \\r
45     lcov\r
46 \r
47 # Cpputest built-in memory checks generate false positives in valgrind.\r
48 # This is solved by compiling cpputest with memory checking disabled.\r
49 \r
50 mkdir -p cpputest/builddir\r
51 cd cpputest\r
52 \r
53 curl -L https://github.com/cpputest/cpputest/releases/download/v3.8/cpputest-3.8.tar.gz | \\r
54     tar --strip-components=1 -xzf -\r
55 cd builddir\r
56 cmake -DMEMORY_LEAK_DETECTION=OFF .. && \\r
57 sudo make install\r
58 cd ../..\r
59 # generate configure script\r
60 cd redismodule\r
61 ./autogen.sh && \\r
62     ./configure && \\r
63 sudo make test\r
64 \r
65 # generate configure script with memory checking disabled.\r
66 \r
67 ./autogen.sh && \\r
68     ./configure --disable-unit-test-memcheck && \\r
69 sudo make test\r
70 cd ..\r
71 \r
72 #Copy configure to $WORKSPACE\r
73 \r
74 cp -r cpputest/* .\r
75 \r
76 echo "--> setup-dbaas-build-deb.sh ends"