Based on this class' project: BEW 2.5 Go Routines Class 7.
CommitPing allows you to set up your own personal monitor to ping you on slack whenever any commits are made on a repository that you set up.
- You set up a Webhook on Github to ping a POST route on this project.
- The Webhook will send a payload of data about the commit.
- Using a SlackAPI, send a custom message to a channel of your choice each time a commit is made to the Github Repo.
- Have these docs open and ready as you configure a Slack Bot User.
- Point your browser to the Create a Slack App page.
- Enter a name that fits the problem you're trying to solve.
- Select Product College workspace from the Workspace drop-down.
- Click the Create App button.
- On the sidebar, under the Features header, click Bot Users.
- Git your bot a display name and a default username.
- Click the Save Changes button.
- Go to OAuth & Permissions and scroll down to the Scopes > Select Permission Scopes text entry field.
- Add
channels:history
,channels:read
, andchannels:write
permission scope and click Save Changes. - Click Install App to Workplace, and make sure you set the contents of the dialog to match the below screenshot. This ensures your bot replies in a particular channel:
#golang-slackbots
. Make sure your OAuth dialog matches the following:
- Fork this starter repo onto the server you're gonna be using.
- Clone the forked repo to your local machine and
cd REPO_NAME
. - Create a
.env
file by runningcp .env.sample .env
. - Paste the Bot Token from Step 9 in
.env
afterBOT_OAUTH_ACCESS_TOKEN=
. - Type
WEBHOOK=password
the line below within the.env
file. - Run
export GO111MODULE=on; go run main.go
to start the server.
- Install ngrok with
npm install ngrok -g
- Run ngrok on the locally running server port
ngrok http 3000
- Copy the link ngrok provides.
- Create a Github Webhook
- Paste your Payload URL from Step 3 of Part 3.
- Set the settings to be the same.
- Set
password
as your Secret or whatever you set in Step 5 of Part 2.
If you followed the instructions properly, you will be pinged over slack each time someone makes a commit to that repo. Like so:
Student Name | Total (Possible) |
Bonus (Possible) |
Total (Earned) |
Bonus (Earned) |
Final Score (Points) |
Final % |
---|---|---|---|---|---|---|
Timofey Makhlay | 200 | 50 | 170 | 0 | 170 | 85% |
Phase | ✓ | Criteria | Points | Score |
---|---|---|---|---|
Propose | ✓ | Repo Contents Matchgit Written Proposal | 15 | 15 |
Propose | ✓ | Utility Has Purpose & Fulfills the Proposal | 15 | 15 |
Implement | ✓ | Source Code Receives a B or Higher on Go Report Card | 50 | 50 |
Implement | Utility Can Persist Data | 25 | 0 | |
Implement | ✓ | Utility Incorporates a Third-Party API | 25 | 25 |
Implement | ✓ | README Contains Go Report Card Badge at Top |
5 | 5 |
Implement | ✓ | Source Code in Public GitHub Repo & Added to Tracker | 5 | 5 |
Implement | ✓ | No Exposed Secrets in Source Code | 5 | 5 |
Implement | ✓ | Properly Defined .gitignore |
5 | 5 |
Implement | ✓ | Attribution Links in Comments for "Borrowed" Code | 5 | 5 |
Deploy | ✓ | Shipped Live & Fully Usable | 30 | 30 |
Document | ✓ | Installation & How to Use Documentation in README |
15 | 15 |
Bonus | 🌟 Add API Key Authentication to Your API | 5 | 0 | |
Bonus | 🌟 Documentation Website, Link in README & Repo Header |
5 | 0 | |
Bonus | 🌟 Test Suite with >80% Code Coverage |
10 | 0 | |
Bonus | 🌟 Published Blog Post About Project | 10 | 0 | |
Bonus | 🌟 Project Released on GoDoc.org | 20 | 0 |