Improve installation script
This is an almost complete rewrite of the installation script, mainly directed to allow installation of Rally also from unprivileged users, but also adding a few more options and checks. More in details, the script now: * can run as unprivileged user. * support different database types * allow to specify custom python binary * always asks confirmation before doing potentially dangerous actions (removing directories or installing software) * automatically install needed software if run as root * this script is self-sufficient: it automatically downloads Rally from the git if needed * if interrupted, cleans up the virtualenv and/or the downloaded repository Co-Authored-By: Antonio Messina <antonio.s.messina@gmail.com> Co-Authored-By: Sergey Skripnick <sskripnick@mirantis.com> Change-Id: I574d4fd7cc7c8e71720a6a5ff8db22ee4fd4fc81 Closes-bug: #1393887
This commit is contained in:
parent
f120828a8d
commit
a9f2cbefc5
@ -3,7 +3,10 @@ MAINTAINER Sergey Skripnick <sskripnick@mirantis.com>
|
|||||||
COPY . /tmp/rally
|
COPY . /tmp/rally
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get -y install git python2.7 bash-completion python-dev libffi-dev \
|
apt-get -y install git python2.7 bash-completion python-dev libffi-dev \
|
||||||
libxml2-dev libxslt1-dev libssl-dev &&\
|
libxml2-dev libxslt1-dev libssl-dev libpq-dev wget \
|
||||||
|
build-essential &&\
|
||||||
|
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O /tmp/pip.py &&\
|
||||||
|
python /tmp/pip.py && rm /tmp/pip.py &&\
|
||||||
cd /tmp/rally &&\
|
cd /tmp/rally &&\
|
||||||
./install_rally.sh &&\
|
./install_rally.sh &&\
|
||||||
pip install -r optional-requirements.txt &&\
|
pip install -r optional-requirements.txt &&\
|
||||||
|
@ -23,10 +23,6 @@ classifier =
|
|||||||
packages =
|
packages =
|
||||||
rally
|
rally
|
||||||
|
|
||||||
data_files =
|
|
||||||
/etc/bash_completion.d =
|
|
||||||
etc/rally.bash_completion
|
|
||||||
|
|
||||||
[entry_points]
|
[entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
rally = rally.cmd.main:main
|
rally = rally.cmd.main:main
|
||||||
|
13
setup.py
13
setup.py
@ -13,7 +13,7 @@
|
|||||||
# implied.
|
# implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
#
|
||||||
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
@ -25,6 +25,17 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
import os
|
||||||
|
if os.getuid() == 0:
|
||||||
|
data_files = [
|
||||||
|
('/etc/bash_completion.d', ['etc/rally.bash_completion']),
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
data_files = [
|
||||||
|
('etc/bash_completion.d', ['etc/rally.bash_completion']),
|
||||||
|
]
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
setup_requires=['pbr'],
|
setup_requires=['pbr'],
|
||||||
|
data_files=data_files,
|
||||||
pbr=True)
|
pbr=True)
|
||||||
|
@ -15,9 +15,18 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
env
|
||||||
|
|
||||||
sudo ./install_rally.sh
|
sudo ./install_rally.sh --system --yes
|
||||||
rally deployment list
|
rally deployment list
|
||||||
|
|
||||||
sudo ./install_rally.sh
|
sudo ./install_rally.sh --system --yes
|
||||||
rally deployment list
|
rally deployment list
|
||||||
|
|
||||||
|
sudo ./install_rally.sh --yes -d /tmp/rallytest_root/
|
||||||
|
/tmp/rallytest_root/bin/rally deployment list
|
||||||
|
|
||||||
|
sudo rm -fr ~/.rally
|
||||||
|
|
||||||
|
./install_rally.sh --yes -d /tmp/rallytest_user
|
||||||
|
/tmp/rallytest_user/bin/rally deployment list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user