GithubHelp home page GithubHelp logo

bern's Introduction

Bern

Bern is a simplistic cloud bot to perform annoying tasks such as logging hours in Redmine

How can I use it?

Bern bot contains a ruby script that you can run every day or create a background job that run for you at certain hour.

Requeriments

SMTP SERVER, SET ENV VARS, NEWRELIC APP

locally

You need to setup a smtp server and set the env vars

HOST REMOTELY

You need to get your smtp servers settings and set as env vars

Instructions for the cloud

  1. Fork and clone this repo

  2. Go to the root folder

  3. Install the heroku toolbelt (https://toolbelt.heroku.com/)

  4. Run this in the folder where you cloned the project to create a heroku app: $ heroku login (and enter your heroku credentials) $ heroku create $ git push heroku master

  5. Add New Relic: $ heroku addons:create newrelic:wayne

  6. Add a SMTP server: $ heroku addons:create sendgrid:starter

  7. Add a scheduler: $ heroku addons:create scheduler:standard

  8. Go to https://dashboard.heroku.com/apps, find your app and click on it, look for the list of addons and open 'Heroku Scheduler'

  9. Enter 'redmine_log_hours' in the blank space, select the dino size='free', frequency='daily' and next due=13:00 UTC (8 am CDT)

  10. Setup the env vars: Run heroku config. You should have already the SENDGRID_PASSWORD, SENDGRID_USERNAME & NEW_RELIC_LICENSE_KEY, so please set these variables:

    $ heroku config:set SMTP_DELIVERY_EMAIL=%EMAIL_TO_RECEIVE_NOTIFICATIONS% $ heroku config:set SMTP_PORT=587 $ heroku config:set SMTP_DOMAIN=heroku.com $ heroku config:set SMTP_SERVER=smtp.sendgrid.net $ heroku config:set SMTP_HOST_EMAIL=%RANDOM_USER%@%HEROKU_APP_NAME%.herokuapp.com

    $ heroku config:set NEW_RELIC_APP_NAME=%APP_NAME%

    $ heroku config:set ACTIVITY_ID=9 $ heroku config:set HOURS=8 $ heroku config:set ISSUE_ID=4547 $ heroku config:set THIRD_PARTY_KEY=%API_KEY% $ heroku config:set THIRD_PARTY_URL=%REDMINE_URL%/time_entries.json

    If you find something like this %SOMETHING_HERE% it means that a user input is required. So please look for the information required and substitute that string with the one you want.

  11. Your app should be running in in heroku: %HEROKU_APP_NAME%.herokuapp.com

Logger

Bern performs a task to logs hours in redmine, therefore you need a little bit of configuration and settings and payload of your **REDMINE SERVER

ENV VARS

SMTP SERVER:

SENDGRID_PASSWORD:     smtp password
SENDGRID_USERNAME:     smtp username
SMTP_DELIVERY_EMAIL:   notification email
SMTP_DOMAIN:           smtp server domain
SMTP_HOST_EMAIL:       host email, your server email for example '[email protected]'
SMTP_PORT:             smtp port
SMTP_SERVER:           smtp host

REDMINE:

ACTIVITY_ID:           redmine activity id
HOURS:                 number of hours
ISSUE_ID:              issue id
THIRD_PARTY_KEY:       redmine api key
THIRD_PARTY_URL:       redmine url

NEWRELIC:

NEW_RELIC_APP_NAME:    newrelic app name
NEW_RELIC_LICENSE_KEY:
NEW_RELIC_LOG:

HOW AM I USING IT?

I've uploaded bern to a heroku app. I've added the scheduler addon and setup to run every day the script redmine_log_hours

I've also added newrelic and send grid addons

Heroku automatically setup for you all env vars as bern requires, then I've just setup the env vars for redmine.

Bern is logging to redmine using the redmine api

Can I collaborate to Bern cloud bot?

Yes you can. Please fork this repo add and test your integration and send me the pull request.

bern's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.