ansible-role-tripleo-modify.../files/dev_install.sh
Chandan Kumar 410408ef1b Ported tripleo-modify-image to py3
It makes yum and pip installs work with py3 packages. The package manager
dnf/yum and pip binary are determined at run time from the OS.

Use dnf-plugins-core for dnf with respect to
yum-plugin-priorities.

Use pipefail with set -ex to fix linter errors.

Change-Id: I997509204e30abb8b21ef936ea44440fbaa5a0e4
Closes-Bug: #1813546
2019-02-18 18:22:40 +05:30

33 lines
828 B
Bash

set -eou pipefail
# Cherry-pick a refspec
# $1 : project name e.g. keystone
# $2 : Gerrit refspec(s) to cherry pick
function cherrypick {
local PROJ_NAME=$1
local REFSPECS="$2"
# check that git is installed
if ! rpm -qi git &> /dev/null; then
echo "Please install git before using this module."
exit 1
fi
if [ ! -d "$PROJ_NAME" ]; then
git clone "https://git.openstack.org/openstack/$PROJ_NAME"
fi
cd "$PROJ_NAME"
for REFSPEC in $REFSPECS; do
git fetch "https://review.openstack.org/openstack/$PROJ_NAME" "$REFSPEC"
git cherry-pick FETCH_HEAD || git cherry-pick --abort
done
SKIP_GENERATE_AUTHORS=1 SKIP_WRITE_GIT_CHANGELOG=1 python setup.py sdist
cp dist/*.tar.gz ../
}
mkdir -p refspec_projects
cd refspec_projects
cherrypick $1 $2