Skip to content

rozsival/oribot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

63 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ApiTree s.r.o.
ApiTree

OriBot

Simple Slack bot to annoy Oriflame teammates with regular worklog agenda.

Where's your worklog?

QA CodeQL Deploy


๐Ÿ’พ Installation

nvm use
yarn install

๐Ÿš€ Deployment

This app is deployed to Google Cloud Run via Deploy action on push to main branch.

After each deployment two parallel processes are started with yarn start:

  • app (yarn start:app) โ€“ bot worker that runs messaging schedule every day at specified time
  • server (yarn start:server) โ€“ public web just for the funsies

To save as many resources as possible, the Cloud Run instance auto-scales to 0 and idles when inactive. For this reason, a Cloud Scheduler job is created to wake OriBot up every day at 9:55 AM (Europe/Prague).

๐Ÿง  Do not forget to update the schedule based on the configuration below.

โš™๏ธ Configuration

The app uses .env config which is based on .env.example:

  • CHANNEL_ID โ€“ Slack channel ID for messaging
  • ClOSURE_DAY โ€“ day of month on which the worklog agenda closes (defaults to 25)
  • DEBUG โ€“ set 1 to disable sending messages and only output to console (defaults to 0)
  • DEBUG_DATE โ€“ when DEBUG=1 use this to simulate a specific date for test run (defaults to undefined)
  • JOB_HOUR โ€“ hour at which the messaging schedule runs daily (defaults to 10)
  • JOB_MONTH_END โ€“ month in which the messaging schedule ends (defaults to 11)
  • JOB_MONTH_START โ€“ month in which the messaging schedule starts (defaults to 2)
  • PORT โ€“ port on which the public web is served (defaults to 8080)
  • TOKEN โ€“ Slack OAuth token for ApiTree workspace
  • TZ โ€“ timezone to be used for dates and times (defaults to Europe/Prague)

โš ๏ธ Values for CHANNEL_ID and TOKEN are mandatory and stored in the Secret Manager.

โ„น๏ธ Right click on channel name in Slack and use View channel details to find channel ID.

๐ŸŽ„ By default, December and January are skipped in schedule due to end-of-year specific closure.

About

๐Ÿ“Š Where's your worklog?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published