Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:8.8

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn test
12 changes: 5 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
HEROKU_URL=https://berend-botje.herokuapp.com
HUBOT_GITHUB_EVENT_NOTIFIER_ROOM=zuidlaren
# Example
HUBOT_GITHUB_EVENT_NOTIFIER_ROOM=my-event-room
HUBOT_GITHUB_EVENT_NOTIFIER_TYPES=pull_request:opened,pull_request:assigned,pull_request:review_requested,issues:opened,issues:assigned,issue_comment,pull_request_review:submitted,status
HUBOT_GITHUB_USERS=wesleydebruijn:wesley,delneet:danieldelnaaij,DeRidder:peter,Jumba:cwongloising
HUBOT_HEROKU_KEEPALIVE_URL=https://berend-botje.herokuapp.com/
HUBOT_SLACK_BOTNAME=Berend
HUBOT_SLACK_TEAM=Websend
HUBOT_GITHUB_USERS=github_username:slack_username,other_github_username:other_slack_username
HUBOT_SLACK_BOTNAME=Hubot
HUBOT_SLACK_TEAM=MySlackTeam
HUBOT_SLACK_TOKEN=xoxb-secret
TZ=Europe/Amsterdam
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
node_modules
.DS_Store*
.hubot_history
.idea
.vagrant

.env
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:8.8

WORKDIR /berend

ADD . /berend

RUN yarn install
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ Berend will notify a developer directly when:
* a build has finished in Jenkins of his/her commit in a branch

## Configuration
Berend can easily be deployed on a free Heroku instance. Only the GitHub repository needs to be connected in Heroku and you're good to go.
Berend runs inside Docker on a node 8.8 image.
Yarn packages are installed when building the image.
See the Dockerfile and docker-compose.yml for more details.


### Environment variables
The following environment variables are required to run Berend. See .env.example for an example.

```
HEROKU_URL
HUBOT_GITHUB_EVENT_NOTIFIER_ROOM // Name of global chatroom in Slack
HUBOT_GITHUB_EVENT_NOTIFIER_TYPES // Accepted GitHub events
HUBOT_GITHUB_USERS // Mapping of GitHub/Slack users (wesleydebruijn:wesley)
HUBOT_HEROKU_KEEPALIVE_URL // Heroku URL
HUBOT_SLACK_BOTNAME // Slack name
HUBOT_SLACK_TEAM // Slack team name
HUBOT_SLACK_TOKEN // Token to get access to Slack
TZ // Timezone

```

Expand Down
48 changes: 48 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
vb.name = "Berend"
vb.memory = "2048"
end

config.vm.provision :docker
config.vm.provision :docker_compose,
compose_version: '1.17.1',
yml: '/vagrant/docker-compose.yml',
project_name: 'berend',
run: 'always',
rebuild: true
end
1 change: 0 additions & 1 deletion bin/hubot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e

npm install
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"

exec node_modules/.bin/hubot --name "Berend" "$@"
2 changes: 1 addition & 1 deletion bin/hubot.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off

npm install && node_modules\.bin\hubot.cmd --name "Berend" %*
node_modules\.bin\hubot.cmd --name "Berend" %*
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '2'
services:
bot:
build: .
command: "/berend/bin/hubot --adapter slack"
ports:
- "8080:8080"
env_file:
- .env
4 changes: 1 addition & 3 deletions external-scripts.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[
"hubot-diagnostics",
"hubot-help",
"hubot-heroku-keepalive",
"hubot-redis-brain",
"hubot-rules"
"hubot-redis-brain"
]
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Berend",
"version": "0.1.0",
"version": "0.2.0",
"private": true,
"author": "Daniel <danieldelnaaij@gmail.com>",
"description": "Berend Botje",
Expand All @@ -9,17 +9,15 @@
"hubot": "^2.16.0",
"hubot-diagnostics": "0.0.1",
"hubot-help": "^0.1.2",
"hubot-heroku-keepalive": "^1.0.0",
"hubot-redis-brain": "0.0.3",
"hubot-rules": "^0.1.1",
"hubot-scripts": "*",
"hubot-slack": "^3.4.1",
"lodash": "^2.4.1",
"moment": "^2.8.1",
"scraper": "0.0.9"
},
"engines": {
"node": "8.1.4",
"npm": "*"
"node": "8.8",
"yarn": "*"
}
}