Skip to content

Instantly share code, notes, and snippets.

@bgulla
Last active April 7, 2019 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgulla/61cdd802b048b036cb0a72d36d7cfd83 to your computer and use it in GitHub Desktop.
Save bgulla/61cdd802b048b036cb0a72d36d7cfd83 to your computer and use it in GitHub Desktop.
Troubleshoot boozer deployments with this handy-dandy script.

Boozer Boilerplate Test

The following instructions are certified-correct way to get yourself a working boozer setup.

Step 1: Setup Environment & dl database file

Run the following commands.

mkdir ~/boozer-test
cd ~/boozer-test
wget https://github.com/bgulla/boozer/raw/master/db/db.sqlite #Downloads the baseline database file.
touch config.ini

Step 2: Edit config file.

Use vim/nano/editor_of_your_choice to create the config file located at config.ini. Paste in the following text. After pasting, be sure to update the GPIO-pin to point to the GPIO that your flow sensor is currently attached to.

[Taps]
tap1_gpio_pin: 24 #Edit this to match your GPIO
tap1_beer_name: Beer Name Goes Here

[Slack]
enabled:False

[Temperature]
enabled: False

[Twitter]
enabled: False

[Logging]
file: /tmp/beer.log

[Mqtt]
enabled: False

[Pushbullet]
api_key=asdf

[Untappd]
api_key=asdf

Step 3: Boozer Time

Run the following commands. If you did everything above (and have your wiring correct, you should have a working boozer)

docker pull boozerbar/boozer
docker run --rm \
  --privileged \
  -v ${PWD}/config.ini:/boozer/config.ini \
  -v ${PWD}/db.sqlite:/boozer/db.sqlite \
  -t boozerbar/boozer

Debugging

If you did the steps above correctly, you should see something like the following.

 ____   ___   ___ __________ ____
| __ ) / _ \ / _ \__  / ____|  _ \
|  _ \| | | | | | |/ /|  _| | |_) |
| |_) | |_| | |_| / /_| |___|  _ <
|____/ \___/ \___/____|_____|_| \_\


+---------------+--------------+--------+
|      File     |   Filepath   | Exists |
+---------------+--------------+--------+
|    Database   | ./db.sqlite  |  True  |
| Configuration | ./config.ini |  True  |
+---------------+--------------+--------+
+-------------+----------+
|   Feature   |  Status  |
+-------------+----------+
|   Twitter   | disabled |
|     Mqtt    | disabled |
| Temperature | disabled |
|    Slack    | disabled |
+-------------+----------+
+-----+---------------------+----------+------------------+
| Tap |         Beer        | GPIO Pin | Volume Remaining |
+-----+---------------------+----------+------------------+
|  1  | Beer Name Goes Here |    24    |      75.475      |
+-----+---------------------+----------+------------------+
2019-04-07 16:07:54,183 root         INFO     Boozer Intialized! Waiting for pours. Drink up, be merry!
2019-04-07 16:07:54,183 root         INFO     Boozer Intialized! Waiting for pours. Drink up, be merry!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment