This repo contains the core logic behind the automation of WeBuild operations. Shout out to our community members for their effort. PRs are welcome.
$ cp .env.example .env ## copy and modify your local env
$ make init ## run base infra (postgres), this command just create a pg host and an empty database
$ make run ## run server, database will be migrated when running server by using gorm.AutoMigrate in cmd/server.go
API: Server should be available at http://localhost:8080 after make run
Slack Bot: We need a slack bot to subscribe events / run commands on channels. You can create a slack bot by following these steps:
-
You can use
ngrok http 8080
to establish apublic URL
from localhost to subscribe Slack events & commands -
Create your slack app at https://api.slack.com/apps
-
Grant permissions in
OAuth & Permissions
:- channels:history
- chat:write
- chat:write.public
- commands
- groups:history
- groups:write
- reactions:read
- users.profile:read
- users:read
- users:read.email
- im:write
- im:read
-
In
Event Subscriptions
: 4.1 FillRequest URL
that should be https://<ngrok_public_URL>/slack/events 4.2 Grant permissions:- message.channels
- message.groups
- reaction_added
- reaction_removed
-
Install your app
to your Slack workspace in Basic Information -
Create your Github Oauth Application here
-
Config Github App callback URL to
https://<ngrok_public_URL>/callback/github/auth
-
Gather
SLACK_TOKEN
,SLACK_SIGNING_SECRET
,SLACK_VERIFICATION_TOKEN
,GITHUB_CLIENT_ID
, andGITHUB_CLIENT_SECRET
in Basic Information and update your.env
User could be created or updated when he sends a msg to Slack channel where Slack bot is invited