Merge "Static code analysis for ric-plt-streaming-protobufs"
[ci-management.git] / jjb / ric-plt-dbaas / setup-dbaas-build-deb.sh
1 #!/bin/bash\r
2 ##############################################################################\r
3 #\r
4 #   Copyright (c) 2020 HCL Technology.\r
5 #\r
6 #   Licensed under the Apache License, Version 2.0 (the "License");\r
7 #   you may not use this file except in compliance with the License.\r
8 #   You may obtain a copy of the License at\r
9 #\r
10 #       http://www.apache.org/licenses/LICENSE-2.0\r
11 #\r
12 #   Unless required by applicable law or agreed to in writing, software\r
13 #   distributed under the License is distributed on an "AS IS" BASIS,\r
14 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
15 #   See the License for the specific language governing permissions and\r
16 #   limitations under the License.\r
17 #\r
18 ##############################################################################\r
19 \r
20 # Installs prerequisites needed to compile & test SDL code\r
21 # and build RPM/DEB packages on a Debian/Ubuntu machine.\r
22 \r
23 echo "--> setup-sdl-build-deb.sh"\r
24 \r
25 # Ensure we fail the job if any steps fail.\r
26 set -eux -o pipefail\r
27 \r
28 # install prereqs\r
29 sudo apt-get update && sudo apt-get -q -y install \\r
30   autoconf-archive libhiredis-dev rpm valgrind \\r
31   libboost-filesystem-dev libboost-program-options-dev libboost-system-dev\r
32 \r
33 # generate configure script\r
34 cd redismodule\r
35 autoreconf --install\r
36 cd ..\r
37 curl -L https://github.com/cpputest/cpputest/releases/download/v3.8/cpputest-3.8.tar.gz | \\r
38     tar --strip-components=1 -xzf -\r
39 cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_COVERAGE=ON -DMEMORY_LEAK_DETECTION=OFF .\r
40 sudo make install\r
41 echo "--> setup-sdl-build-deb.sh ends"