Pass multiple pattern args in logs-deploy.sh
[releng/global-jjb.git] / shell / pip-install.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 # pip install packages into a virtualenv using the first listed package as venv name
12 #
13 # PIP_PACKAGES is a space separated list of pypi packages to install. The first
14 #              listed package is used as the virtualenv directory name.
15 echo "---> pip-install.sh"
16
17 # Ensure we fail the job if any steps fail.
18 # DO NOT set -u as virtualenv's activate script has unbound variables
19 set -e -o pipefail
20
21 # Install git-review using virtualenv to the latest version that supports
22 # --reviewers option, available through pip install. Existing minion image has a
23 # version that does not have it.
24 virtualenv "/tmp/v/${PIP_PACKAGES%% *}"
25 # shellcheck source=/tmp/v/venv/bin/activate disable=SC1091
26 source "/tmp/v/${PIP_PACKAGES%% *}/bin/activate"
27 pip install --quiet --upgrade "pip==9.0.3" setuptools
28 pip install --quiet --upgrade pipdeptree
29
30 # PIP_PACKAGES needs to be passed through as a space separated list of packages
31 # shellcheck disable=SC2086
32 pip install --upgrade $PIP_PACKAGES
33
34 echo "----> Pip Dependency Tree"
35 pipdeptree