This container handles the gathering of Ansible Meetup data, the generating/sending of the email report, and the updater for Discourse. Each task can be run independently (caveat that get_events.R
has run at least once to make a dataset).
This container requires two mount points:
- a config dir mounted to
/srv/docker-config/meetup
for the OAuth token, meetup list, and email config - a
pins
dir mounted to/srv/docker-pins/meetup
for storing/reading data
Inside the container it should look like this:
/srv/docker-config
└── meetup
├── email.yml
├── httr-oauth.meetupr
└── meetups.yml
/srv/docker-pins
└── meetup
Getting the OAuth token is a bit fiddly. In short, look at the MeetupR docs and generate one. Ask me if you get stuck. Save the file in the config mount-point as above
I'm assuming a Gmail account in the code, just provide a file that looks like the example in this repo.
Yaml file of white- and black-listed meetups. The code actually downloads this file directly from GitHub, so just open PRs against it.
podman build --tag meetupr .
All the tasks are designed for a single execution
This is the default action and builds a pin
of the groups and events
podman run --rm -ti -v /srv/docker-config/meetup/:/srv/docker-config/meetup/ -v /srv/docker-pins/meetup:/srv/docker-pins/meetup meetupr:latest Rscript get_events.R
This renders meetup_report.Rmd
and emails it
podman run --rm -ti -v /srv/docker-config/meetup/:/srv/docker-config/meetup/ -v /srv/docker-pins/meetup:/srv/docker-pins/meetup meetupr:latest Rscript send_email.R
Uses the API of Discourse to create events - requires a Discourse block in the config file, see the example.
podman run --rm -ti -v /srv/docker-config/meetup/:/srv/docker-config/meetup/ -v /srv/docker-pins/meetup:/srv/docker-pins/meetup meetupr:latest Rscript update_discourse.R
You can run an R shell in the container - this is the container default:
podman run --rm -ti -v /srv/docker-config/meetup/:/srv/docker-config/meetup/ -v /srv/docker-pins/meetup:/srv/docker-pins/meetup meetupr:latest