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:
Antonio Messina 2015-03-07 18:29:32 +01:00 committed by Sergey Skripnick
parent f120828a8d
commit a9f2cbefc5
4 changed files with 27 additions and 8 deletions

View File

@ -3,7 +3,10 @@ MAINTAINER Sergey Skripnick <sskripnick@mirantis.com>
COPY . /tmp/rally
RUN apt-get update && \
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 &&\
./install_rally.sh &&\
pip install -r optional-requirements.txt &&\

View File

@ -23,10 +23,6 @@ classifier =
packages =
rally
data_files =
/etc/bash_completion.d =
etc/rally.bash_completion
[entry_points]
console_scripts =
rally = rally.cmd.main:main

View File

@ -13,7 +13,7 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
@ -25,6 +25,17 @@ try:
except ImportError:
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(
setup_requires=['pbr'],
data_files=data_files,
pbr=True)

View File

@ -15,9 +15,18 @@
# License for the specific language governing permissions and limitations
# under the License.
env
sudo ./install_rally.sh
sudo ./install_rally.sh --system --yes
rally deployment list
sudo ./install_rally.sh
sudo ./install_rally.sh --system --yes
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