Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 3.21 KB

README.md

File metadata and controls

68 lines (50 loc) · 3.21 KB

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.