Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Fix dependencies, add documentation and start script #154

Merged
merged 2 commits into from
Feb 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
55 changes: 55 additions & 0 deletions scripts/pushmanager
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== in setup.py is usually wrong and reserved for requirements.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I just followed the style of the project.

Expand Down