Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

sairam/gitnotify

Repository files navigation

Build Status Code Climate Issue Count codecov

gitnotify

Github and Gitlab Release/Branch Version Watcher

Get periodic emails about the code diff for Gitlab and Github repositories

How to Setup

Install dep and run dep ensure to fetch to local vendor/ directory

List of dependencies used -

Authorization via Github/Gitlab - golang.org/x/oauth2
Authentication - github.com/markbates/goth
Request Router - github.com/gorilla/mux
Sessions - github.com/gorilla/sessions
Sending Emails - gopkg.in/gomail.v2
Cron - gopkg.in/sairam/cron.v2
Yaml Parser - gopkg.in/yaml.v2
Github API - github.com/google/go-github/github
Gitlab API - github.com/xanzy/go-gitlab
Convert between different Go Types - github.com/spf13/cast
TimeZone List - github.com/sairam/timezone
Finding Differences - github.com/aryann/difflib

How to build for Linux

  • env GOOS=linux GOARCH=amd64 go build

Runtime Dependencies

  • cp .env.sample .env.prod
  • edit config.yml
  • ls tmpl/

Running on a Linux/Mac environment

  1. mkdir sessions
  2. Fill in the .env.prod file and modify config.yml
  3. Load the env variables from .env.prod
  4. Use the binary gitnotify and tmpl/ directory
  5. Start with ./gitnotify in a screen. All logs are currently written to stdout

Backup

  1. take a copy of the config.yml -> dataDir or data/ directory
  2. take a copy of the sessions/ directory
  3. The .env.prod file containing the environment variables
  4. The config.yml file containing the settings

FAQ

Can I run this inside my own organisation

Only the Configuration needs to be setup.

Disclaimer

I started learning Go (~Sep 2016) and this is my first moderate sized project trying to "solve" a problem

Flow of user

Development Flow

  1. Users login via Github
  2. Users keep "an eye" on a project
  3. Notifies users on
  4. creation of new branches/tags
  5. Track a branch for latest commits and links
  6. Send email with summary

User Flow

  1. Landing Page at /home
  2. User logins via Github to authenticate/track
  3. User adds url of repository to track creation of branches/tags and/or branches for latest commits
  4. User receives a confirmation email with the current list of branches
  5. Users receives an email once a day about the information that has changed

Backend Flow

  1. A non logged in user sees the static page present at /home at /
  2. User logs in via Github/Gitlab
  3. Settings page has a set of repositories s/he is tracking
  4. Suggestions based on code language can be pulled for user to track
  5. Once user adds the config, we save it to the settings
  6. After validating the config, an email is sent to the user with the action made
  7. A cron job or daemon uses the user's token to pull the required information
  8. Diffs with the previous information that is present
  9. Sends an email to the user with changes based on settings

Configuration

  • Copy .env.example to .env
  • Fill in data into .env
  • environment variables required to be loaded for the server to run

TODO

Get an update on demand from slack - http://www.hongkiat.com/blog/custom-slash-command-slack/

About

Notify users about new branches and track commits/merges done on branches

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published