1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/README.md

98 lines
2.3 KiB
Markdown
Raw Normal View History

2018-11-22 19:35:04 +00:00
Partynest
=========
2018-11-28 14:43:05 +00:00
2018-12-05 22:09:34 +00:00
[![Build Status](https://travis-ci.org/libertarian-party/partynest.svg?branch=master)](https://travis-ci.org/libertarian-party/partynest)
2018-12-05 22:32:07 +00:00
[![Coverage Status](https://coveralls.io/repos/github/libertarian-party/partynest/badge.svg?branch=master)](https://coveralls.io/github/libertarian-party/partynest?branch=master)
2018-12-05 22:09:34 +00:00
[![Maintainability](https://api.codeclimate.com/v1/badges/974d97f03895453189e1/maintainability)](https://codeclimate.com/github/libertarian-party/partynest/maintainability)
[![Inline docs](http://inch-ci.org/github/libertarian-party/partynest.svg?branch=master)](http://inch-ci.org/github/libertarian-party/partynest)
2018-12-05 23:04:51 +00:00
A web application to manage political party members and supporters.
2018-12-05 19:52:50 +00:00
Table of contents
-----------------
* [Overview](#partynest)
* [Table of contents](#table-of-contents)
2018-12-05 20:31:14 +00:00
* [Deploy](#deploy)
Deploy
------
Tested with **Ubuntu Server 18.04 LTS**.
### System packages
* `build-essential`
* `bundler`
* `liblzma-dev`
* `libpq-dev`
* `nodejs`
* `npm`
* `patch`
* `ruby`
* `ruby-dev`
* `rubygems-integration`
* `zlib1g-dev`
### Steps
* Create directory `/opt/partynest/` writable by deploy user
* Copy file `config/master.key` to `/opt/partynest/shared/config/`
2018-12-05 20:31:14 +00:00
* Create PostgreSQL role `partynest` with password `password`
* Create PostgreSQL database `partynest_production` owned by `partynest`
2018-12-05 21:28:51 +00:00
2018-12-07 13:53:10 +00:00
### Example systemd services
2018-12-05 21:28:51 +00:00
2018-12-07 13:53:10 +00:00
Replace `user` with the name of user and `group` with the name of group
which you want an application to run as.
#### Web server
2018-12-05 21:28:51 +00:00
```
[Unit]
2018-12-07 13:53:10 +00:00
After=syslog.target network.target
2018-12-05 21:28:51 +00:00
Description=Partynest web server
[Service]
ExecStart=/usr/bin/bundle exec rails server --environment production
2018-12-07 13:53:10 +00:00
Group=group
Restart=on-failure
RestartSec=1
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=partynest-web
Type=simple
User=user
WorkingDirectory=/opt/partynest/current
2018-12-07 13:53:10 +00:00
[Install]
WantedBy=multi-user.target
```
#### Job processing
```
[Unit]
After=syslog.target network.target
Description=Partynest job processing
[Service]
ExecStart=/usr/bin/bundle exec sidekiq --environment production
Group=group
Restart=on-failure
RestartSec=1
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=partynest-worker
2018-12-05 21:28:51 +00:00
Type=simple
User=user
WorkingDirectory=/opt/partynest/current
2018-12-05 21:28:51 +00:00
[Install]
WantedBy=multi-user.target
```