A simple bot that manages shared Google Calendar
We need a bot that would manage our GCal user for a meeting room. The bot checks GCal with some configurable interval and accepts or declines upcoming events depending on the conflicts
-
Follow the Google Calendar API Go guide to setup your project and get credetials. Save the credentials to
client_credentials.json
insrc
folder. -
Create
config.yaml
in the root folder like this sample:
email: meetingroom@mydomain.com
checkinterval: 60
-
Build Docker container
docker build -t itomychstudio/calendarbot .
-
First run should be done in the interactive mode to get the token from Google OAuth2
docker run -it --name calendarbot itomychstudio/calendarbot:latest
-
Afterwards, you can run the container in the detached mode
docker run -d --name calendarbot --restart always itomychstudio/calendarbot:latest
.
If you cannot run the container in the interactive mode, run the app locally and copy the ~/.credentials/itomych-calendar-bot.json file to the root folder of the project. It will be automatically copied to the container on docker build.