blob: 458bbd08d73621e2cb478652338cd44e1701bdc0 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
Davide Pesavento552174c2020-04-16 01:54:08 -04002set -ex
Zhiyi Zhang8617a792017-01-17 16:45:56 -08003
4if has OSX $NODE_LABELS; then
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento552174c2020-04-16 01:54:08 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05008 fi
Zhiyi Zhang8617a792017-01-17 16:45:56 -08009
Davide Pesavento552174c2020-04-16 01:54:08 -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
Zhiyi Zhang8617a792017-01-17 16:45:56 -080027 sudo apt-get -qq update
Davide Pesavento552174c2020-04-16 01:54:08 -040028 sudo apt-get -qy install g++ pkg-config python3-minimal \
29 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050030
31 if [[ $JOB_NAME == *"code-coverage" ]]; then
ashiqopu83ad2c02018-11-25 06:49:52 +000032 sudo apt-get -qy install gcovr lcov libgd-perl
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050033 fi
Zhiyi Zhang8617a792017-01-17 16:45:56 -080034fi