Add dockerized version.

This commit is contained in:
Anna Rose 2019-12-04 16:44:50 -05:00
parent 1d5d9d39da
commit 3db7e655bb
3 changed files with 34 additions and 3 deletions

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM ruby:2.3
WORKDIR /run
COPY Gemfile serialboard.rb /run/
RUN bundle install
ENTRYPOINT ruby /run/serialboard.rb

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
DOCKER_REGISTRY ?= local
DOCKER_TAG ?= latest
.PHONY: all docker_build docker_push
all: docker_build
docker_build: serialboard.rb
docker build . -t ${DOCKER_REGISTRY}/serialboard:${DOCKER_TAG}
docker_push:
docker push ${DOCKER_REGISTRY}/serialboard${DOCKER_TAG}

View File

@ -5,13 +5,15 @@ serialboard is a simple script that uses the <pinboard.in> API to make following
## Installation
First install ruby, then just:
With docker installed, building a docker image is as easy as:
$ make
If you don't like docker, you should be able to get by with:
$ gem install bundler
$ bundle install
Now copy config.yml.example to config.yml, and edit it to use your Pinboard API key.
## Configuration
Copy the `config.yml.example` to `config.yml` and edit it to use your API token. You can add additional tokens to process multiple accounts as well, e.g.:
@ -29,8 +31,18 @@ Copy the `config.yml.example` to `config.yml` and edit it to use your API token.
Read your web serial, and when you get to the end or a stopping place you want to pick up from later, just bookmark the page on pinboard and tag it with your active tag. (by default the active tag is 'serial') You can do this on as many different sites as you want!
### Without Docker
To clean up 'old' bookmarks for each domain, just run:
$ ./pinboard.rb
This will 'delete' all but the most recent bookmark for each domain. (actually it just replaces the active tag with the deleted tag, and un-shares the bookmark) For best results, run this in a daily cron job!
### With Docker
If you want to containerize this application, build the docker image as above.
You can run with:
$ docker run --rm -it -v $(pwd)/config.yml:/run/config.yml local/serialboard