Simple Slack bot to annoy Oriflame teammates with regular worklog agenda.
nvm use
yarn install
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.
The app uses .env
config which is based on .env.example
:
CHANNEL_ID
โ Slack channel ID for messagingClOSURE_DAY
โ day of month on which the worklog agenda closes (defaults to25
)DEBUG
โ set1
to disable sending messages and only output to console (defaults to0
)DEBUG_DATE
โ whenDEBUG=1
use this to simulate a specific date for test run (defaults toundefined
)JOB_HOUR
โ hour at which the messaging schedule runs daily (defaults to10
)JOB_MONTH_END
โ month in which the messaging schedule ends (defaults to11
)JOB_MONTH_START
โ month in which the messaging schedule starts (defaults to2
)PORT
โ port on which the public web is served (defaults to8080
)TOKEN
โ Slack OAuth token for ApiTree workspaceTZ
โ timezone to be used for dates and times (defaults toEurope/Prague
)
โ ๏ธ Values forCHANNEL_ID
andTOKEN
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.