blob: 0e81bf916a995d6331ce31267641b19a4f7004b5 [file] [log] [blame]
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08001#!/usr/bin/env bash
Davide Pesavento69857c32020-04-05 16:36:26 -04002set -ex
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08003
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +00004if has OSX $NODE_LABELS; then
Davide Pesaventoc25737c2017-08-26 13:18:17 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento69857c32020-04-05 16:36:26 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesavento7744a4a2017-06-20 21:29:56 -04008 fi
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08009
Davide Pesavento69857c32020-04-05 16:36:26 -040010 if [[ -n $TRAVIS ]]; then
11 # Travis images come with a large number of pre-installed
12 # brew packages, don't waste time upgrading all of them
13 brew list --versions "${FORMULAE[@]}" || brew update
14 for FORMULA in "${FORMULAE[@]}"; do
15 brew list --versions "$FORMULA" || brew install "$FORMULA"
16 done
17 # Ensure /usr/local/opt/openssl exists
18 brew reinstall openssl
19 else
20 brew update
21 brew upgrade
22 brew install "${FORMULAE[@]}"
23 brew cleanup
24 fi
25
26elif has Ubuntu $NODE_LABELS; then
Davide Pesaventocc7bee72016-04-22 02:21:13 +020027 sudo apt-get -qq update
Davide Pesaventob7e72c32020-10-02 20:00:03 -040028 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesavento69857c32020-04-05 16:36:26 -040029 libboost-all-dev libssl-dev libsqlite3-dev \
30 libpcap-dev libsystemd-dev
Davide Pesavento8d61c032017-04-29 20:06:33 -040031
32 if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesaventobc0e6172020-08-07 13:08:25 -040033 sudo apt-get -qy install gcovr lcov
Davide Pesavento8d61c032017-04-29 20:06:33 -040034 fi
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000035
Davide Pesavento8f290fc2020-04-12 13:20:07 -040036elif has CentOS-8 $NODE_LABELS; then
Davide Pesavento9ab43e62020-12-27 20:07:25 -050037 sudo dnf config-manager --enable powertools
Davide Pesavento8f290fc2020-04-12 13:20:07 -040038 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
39 boost-devel openssl-devel sqlite-devel \
40 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000041fi