-
Notifications
You must be signed in to change notification settings - Fork 3
/
create_env.sh
executable file
·55 lines (43 loc) · 1.18 KB
/
create_env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
echo "user: $USER"
echo "path: $PATH"
python3 --version
pip3 --version
docker --version
#kubectl version --short
#minikube version
#helm version
#go version
echo Setting up python environment \(systests_python_env\)
set -e
LOGFILE=/tmp/last_install_$$.log
SCRIPTPATH="$(
cd "$(dirname "$0")"
pwd -P
)"
echo "Path: ${SCRIPTPATH}"
if ! python3 -m venv systests_python_env; then
echo "Failed to create python environment"
exit 1
fi
echo "${PWD}"
if [ "$(uname)" == "Darwin" ]; then
echo "OS: Mac"
# Needed only on M1 Macs
# https://github.com/psycopg/psycopg2/issues/1286
brew install postgresql
brew install cmake
brew install openssl
brew link openssl --force
source systests_python_env/bin/activate
LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" CFLAGS="-I$(brew --prefix openssl@1.1)/include" pip3 install -r requirements.txt
brew unlink openssl
else
echo "OS: Linux"
. systests_python_env/bin/activate
pip3 install -r requirements.txt
wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh -O cmake.sh
sudo sh cmake.sh --prefix=/usr/local/ --exclude-subdir
fi
rm -rf $LOGFILE 2>/dev/null || true
deactivate