summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/rook/rook-client-python/generate.sh
blob: f7de74aeb79fa7ce6e7b34b0f502df7bb989861d (plain)
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
#!/bin/bash

set -ex

if [ -z "$1" ] ; then
    rook_base="${GOPATH:-$HOME/go}/src/github.com/rook/rook"
else
    rook_base="$1"
fi
crd_base="$rook_base/cluster/examples/kubernetes"

cd "$(dirname "$0")"

if ! [ -x "$(command -v python3)" ]; then
  echo 'Error: python3 is not installed.' >&2
  exit 1
fi

if [ ! -d venv ]
then
  python3 -m venv venv
  . venv/bin/activate
  pip install -r requirements.txt
else
  . venv/bin/activate 
fi

python generate_model_classes.py "$crd_base/ceph/crds.yaml" "rook_client/ceph"
#python generate_model_classes.py "$crd_base/cassandra/operator.yaml" "rook_client/cassandra"

python setup.py develop

tox --skip-missing-interpreters=true -- --crd_base="$crd_base"

deactivate