diff --git a/README.rst b/README.rst index 3bff5e3..195ab38 100644 --- a/README.rst +++ b/README.rst @@ -6,6 +6,30 @@ at Yelp. It helps pushmasters to conduct the deployment by bringing together push requests from engineers and information gathered from reviews, test builds and issue tracking system. + +Quick Start +----------- + +- ``python setup.py install`` +- Create a config.yaml somewhere, e.g. as /etc/pushmanager/config.yaml. Use config.yaml.example as template. You need to change at least these settings: + + - main_app.servername + - db_uri (use a local sqlite file, e.g. sqlite:////var/lib/pushmanager/sqlite.db) + - username (effective user of service, either your own username or something like www-data) + - log_path (this path must exist) + - ssl_certfile and ssl_keyfile (see below) + +- You need a SSL certificate. If you don't have one lying around, you can create it: + + ``openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650 -nodes`` + +- You also need to configure either SAML or LDAP for user authentication (see the example file). + +- Point to your configuration file: ``export SERVICE_ENV_CONFIG_PATH=/etc/pushmanager/config.yaml`` + +- Now start Pushmanager: ``pushmanager.sh start``. You should be able to point your webbrowser to + ``https://main_app.servername:main_app.port`` and see a login screen. + TODO: README update Changelog diff --git a/requirements.txt b/requirements.txt index 0729403..0c424d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +PyYAML==3.11 +SQLAlchemy==0.9.8 lxml==2.2.4 mysql-python==1.2.5 python-daemon==1.5.2 diff --git a/scripts/pushmanager b/scripts/pushmanager new file mode 100755 index 0000000..385f7e6 --- /dev/null +++ b/scripts/pushmanager @@ -0,0 +1,55 @@ +#!/bin/bash + +COMMAND=$1 + +PUSHMANAGER_MAIN=pushmanager_main +PUSHMANAGER_API=pushmanager_api + +service_start() { + echo -n "Starting" + $PUSHMANAGER_API start + $PUSHMANAGER_MAIN start + print_okay $? +} + +service_stop() { + echo -n "Stopping" + $PUSHMANAGER_API stop + $PUSHMANAGER_MAIN stop + print_okay $? +} + +service_reload() +{ + echo -n "Reloading" + $PUSHMANAGER_API restart + $PUSHMANAGER_MAIN restart + print_okay $? +} + +print_okay() { + if [ "$1" = 0 ]; then + echo "... [OK]" + else + echo "... [Failed]" + fi +} + +case "$COMMAND" in + start) + service_start + ;; + + stop) + service_stop + ;; + + restart|reload) + service_reload + ;; + + *) + echo "Usage: $0 {start|stop|reload|restart}" + exit 1 + ;; +esac diff --git a/setup.py b/setup.py index 5b5a33f..7abaf89 100755 --- a/setup.py +++ b/setup.py @@ -33,8 +33,13 @@ 'pushmanager_main = pushmanager.pushmanager_main:main', ], }, + scripts=[ + 'scripts/pushmanager', + ], setup_requires=['setuptools'], install_requires=[ + 'PyYAML == 3.11', + 'SQLAlchemy == 0.9.8', 'lxml == 2.2.4', 'mysql-python == 1.2.5', 'python-daemon == 1.5.2',