diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5dd3fbd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM ruby:2.3 + +WORKDIR /run +COPY Gemfile serialboard.rb /run/ +RUN bundle install +ENTRYPOINT ruby /run/serialboard.rb diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..99674ce --- /dev/null +++ b/Makefile @@ -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} diff --git a/Readme.md b/readme.md similarity index 76% rename from Readme.md rename to readme.md index 47883de..f1a27f3 100644 --- a/Readme.md +++ b/readme.md @@ -5,13 +5,15 @@ serialboard is a simple script that uses the 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