• This repository has been archived on 05/Apr/2022
  • Stars
    star
    2,759
  • Rank 16,505 (Top 0.4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Continuous integration server built on top of Jenkins and Hubot

Janky

As of April 2022, this repository is no longer used or maintained.


This is Janky, a continuous integration server built on top of Jenkins, controlled by Hubot, and designed for GitHub.

  • Built on top of Jenkins. The power, vast amount of plugins and large community of the popular CI server all wrapped up in a great experience.

  • Controlled by Hubot. Day to day operations are exposed as simple Hubot commands that the whole team can use.

  • Designed for GitHub. Janky creates the appropriate web hooks for you and the web app restricts access to members of your GitHub organization.

Hubot usage

Start by setting up a new Jenkins job and GitHub web hook for a repository: [ORG]/[REPO]

hubot ci setup github/janky

The setup command can safely be run over and over again. It won't do anything unless it needs to. It takes an optional name argument: [ORG]/[REPO] [NAME]

hubot ci setup github/janky janky-ruby1.9.2

It also takes an optional template argument: [ORG]/[REPO] [NAME] [TEMPLATE]

hubot ci setup github/janky janky-ruby1.9.2 ruby-build

All branches are built automatically on push. Disable auto build with:

hubot ci toggle [REPO]

NOTE: If name was set you'll need to use it intested.

hubot ci toggle [NAME]

Run the command again to re-enable it. Force a build of the master branch:

hubot ci build [REPO]

NOTE: If name was set you'll need to use it intested.

hubot ci build [NAME]

Of a specific branch: [REPO]/[BRANCH]

hubot ci build janky/libgit2

Different builds aren't relevant to the same chat room and so Janky lets you choose where notifications are sent to. First get a list of available rooms:

hubot ci rooms

Then pick one:

hubot ci set room janky The Serious Room

Get the status of a build:

hubot ci status janky

Specific branch: [REPO]/[BRANCH]

hubot ci status janky/libgit2

All builds:

hubot ci status

Finally, get a quick reference of the available commands with:

hubot ci?

Installing

Jenkins

Janky requires access to a Jenkins server. Version 1.580 is recommended. Refer to the Jenkins documentation for installation instructions and install the Notification Plugin version 1.4.

Remember to set the Jenkins URL in http://your-jenkins-server.com/configure. Janky will still trigger builds but will not update the build status without this set.

Deploying

Janky is designed to be deployed to Heroku.

Grab all the necessary files from the gist:

$ git clone git://gist.github.com/1497335 janky

Then push it up to a new Heroku app:

$ cd janky
$ heroku create --stack cedar
$ bundle install
$ git add Gemfile.lock
$ git commit Gemfile.lock -m "lock bundle"
$ git push heroku master

After configuring the app (see below), create the database:

$ heroku run rake db:migrate

NOTE: Ruby version 2.0.0+ is required to run Janky.

Upgrading

We strongly recommend backing up your Janky database before upgrading.

The general process is to then upgrade the gem, and then run migrate. Here is how you do that on a local box you have access to (this process will differ for Heroku):

cd [PATH-TO-JANKY]
gem update janky
rake db:migrate

Configuring

Janky is configured using environment variables. Use the heroku config command:

$ heroku config:add VARIABLE=value

Required settings:

  • JANKY_BASE_URL: The application URL with a trailing slash. Example: http://mf-doom-42.herokuapp.com/.
  • JANKY_BUILDER_DEFAULT: The Jenkins server URL with a trailing slash. Example: http://jenkins.example.com/. For basic auth, include the credentials in the URL: http://user:[email protected]/. Using GitHub OAuth with Jenkins is not supported by Janky.
  • JANKY_CONFIG_DIR: Directory where build config templates are stored. Typically set to /app/config on Heroku.
  • JANKY_HUBOT_USER: Login used to protect the Hubot API.
  • JANKY_HUBOT_PASSWORD: Password for the Hubot API.
  • JANKY_GITHUB_USER: The login of the GitHub user used to access the API. Requires Administrative privileges to set up service hooks.
  • JANKY_GITHUB_PASSWORD: The password for the GitHub user.
  • JANKY_GITHUB_HOOK_SECRET: Secret used to sign hook requests from GitHub.
  • JANKY_CHAT_DEFAULT_ROOM: Chat room where notifications are sent by default.

Optional database settings:

  • DATABASE_URL: Database connection URL. Example: postgres://user:password@host:port/db_name.
  • JANKY_DATABASE_SOCKET: Path to the database socket. Example: /var/run/mysql5/mysqld.sock.

GitHub Enterprise

Using Janky with GitHub Enterprise requires one extra setting:

  • JANKY_GITHUB_API_URL: Full API URL of the instance, with a trailing slash. Example: https://github.example.com/api/v3/.

GitHub Status API

https://github.com/blog/1227-commit-status-api

To update pull requests with the build status generate an OAuth token via the GitHub API:

curl -u username:password \
  -d '{ "scopes": [ "repo:status" ], "note": "janky" }' \
  https://api.github.com/authorizations

then set JANKY_GITHUB_STATUS_TOKEN. Optionally, you can also set JANKY_GITHUB_STATUS_CONTEXT to send a context to the GitHub API by default

username and password in the above example should be the same as the values provided for JANKY_GITHUB_USER and JANKY_GITHUB_PASSWORD respectively.

Chat notifications

HipChat

Required settings:

  • JANKY_CHAT=hipchat
  • JANKY_CHAT_HIPCHAT_TOKEN: authentication token (This token needs to be an admin token, not a notification token.)
  • JANKY_CHAT_HIPCHAT_FROM: name that messages will appear be sent from. Defaults to CI.
  • JANKY_HUBOT_USER should be XMPP/Jabber username in format xxxxx_xxxxxx rather than email
  • JANKY_CHAT_DEFAULT_ROOM should be the name of the room instead of the XMPP format, for example: Engineers instead of xxxx_xxxxxx.

Installation:

  • Add require "janky/chat_service/hipchat" to the config/environment.rb file before the Janky.setup(ENV) line.
  • echo 'gem "hipchat", "~>0.4"' >> Gemfile
  • bundle
  • git commit -am "install hipchat"

Slack

Required settings:

  • JANKY_CHAT=slack
  • JANKY_CHAT_SLACK_TEAM: slack team name
  • JANKY_CHAT_SLACK_TOKEN: authentication token for the user sending build notifications.
  • JANKY_CHAT_SLACK_USERNAME: name that messages will appear be sent from. Defaults to CI.
  • JANKY_CHAT_SLACK_ICON_URL: URL to an image to use as the icon for this message.

Installation:

  • Add require "janky/chat_service/slack" to the config/environment.rb file before the Janky.setup(ENV) line.
  • echo 'gem "slack.rb"' >> Gemfile
  • bundle
  • git commit -am "install slack"

Hubot

Sends notifications to Hubot via janky script.

Required settings:

  • JANKY_CHAT=hubot
  • JANKY_CHAT_HUBOT_URL: URL to your Hubot instance.
  • JANKY_CHAT_HUBOT_ROOMS: List of rooms which can be set via ci set room.
    • For IRC: Comma-separated list of channels "#room, #another-room"
    • For Campfire/HipChat: List with room id and name "34343:room, 23223:another-room"
    • For Slack: List with room names "room, another-room"

Installation:

  • Add require "janky/chat_service/hubot" to the config/environment.rb file before the Janky.setup(ENV) line.

Authentication

To restrict access to members of a GitHub organization, register a new OAuth application on GitHub with the callback set to $JANKY_BASE_URL/auth/github/callback then set a few extra settings:

  • JANKY_SESSION_SECRET: Random session cookie secret. Typically generated by a tool like pwgen.
  • JANKY_AUTH_CLIENT_ID: The client ID of the OAuth application.
  • JANKY_AUTH_CLIENT_SECRET: The client secret of the OAuth application.
  • JANKY_AUTH_ORGANIZATION: The organization name. Example: "github".
  • JANKY_AUTH_TEAM_ID: An optional team ID to give auth to. Example: "1234".

Hubot

Install the janky script in your Hubot then set the HUBOT_JANKY_URL environment variable. Example: http://user:[email protected]/_hubot/, with user and password replaced by JANKY_HUBOT_USER and JANKY_HUBOT_PASSWORD respectively.

Custom build configuration

The default build command should suffice for most Ruby applications:

$ bundle install --path vendor/gems --binstubs
$ bundle exec rake

For more control you can add a script/cibuild at the root of your repository for Jenkins to execute instead.

For total control, whole Jenkins' config.xml files can be associated with Janky builds. Given a build called windows and a template name of psake, Janky will try config/jobs/psake.xml.erb to use a template, config/jobs/windows.xml.erb to try the job name if the template does not exit, before finally falling back to the default configuration, config/jobs/default.xml.erb. After updating or adding a custom config, run hubot ci setup again to update the Jenkins server.

Hacking

Docker and docker-compose are required for hacking on this project.

Get your environment up and running:

script/bootstrap

Create the databases, tables, and seed data:

script/setup

Start the server:

docker-compose run --service-ports app script/server

Open the app:

open http://localhost:9393/

Run the test suite:

docker-compose run --rm app script/test

Contributing

Fork the Janky repository on GitHub and send a Pull Request. Note that any changes to behavior without tests will be rejected. If you are adding significant new features, please add both tests and documentation.

Maintainers

Copying

Copyright ยฉ 2011-2014, GitHub, Inc. See the COPYING file for license rights and limitations (MIT).

More Repositories

1

gitignore

A collection of useful .gitignore templates
160,684
star
2

copilot-docs

Documentation for GitHub Copilot
23,229
star
3

docs

The open-source repo for docs.github.com
JavaScript
14,053
star
4

opensource.guide

๐Ÿ“š Community guides for open source creators
HTML
12,947
star
5

gh-ost

GitHub's Online Schema-migration Tool for MySQL
Go
11,302
star
6

linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
Ruby
10,684
star
7

semantic

Parsing, analyzing, and comparing source code across many languages
Haskell
8,865
star
8

copilot.vim

Neovim plugin for GitHub Copilot
Vim Script
8,286
star
9

codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
CodeQL
7,579
star
10

roadmap

GitHub public roadmap
7,393
star
11

scientist

๐Ÿ”ฌ A Ruby library for carefully refactoring critical paths.
Ruby
7,389
star
12

personal-website

Code that'll help you kickstart a personal website that showcases your work as a software developer.
HTML
7,243
star
13

markup

Determines which markup library to use to render a content file (e.g. README) on GitHub
Ruby
5,678
star
14

dmca

Repository with text of DMCA takedown notices as received. GitHub does not endorse or adopt any assertion contained in the following notices. Users identified in the notices are presumed innocent until proven guilty. Additional information about our DMCA policy can be found at
DIGITAL Command Language
5,457
star
15

swift-style-guide

**Archived** Style guide & coding conventions for Swift projects
4,770
star
16

gemoji

Emoji images and names.
Ruby
4,280
star
17

training-kit

Open source courseware for Git and GitHub
HTML
4,247
star
18

explore

Community-curated topic and collection pages on GitHub
Ruby
3,840
star
19

mona-sans

Mona Sans, a variable font from GitHub
3,680
star
20

hubot-scripts

DEPRECATED, see https://github.com/github/hubot-scripts/issues/1113 for details - optional scripts for hubot, opt in via hubot-scripts.json
CoffeeScript
3,538
star
21

choosealicense.com

A site to provide non-judgmental guidance on choosing a license for your open source project
Ruby
3,379
star
22

git-sizer

Compute various size metrics for a Git repository, flagging those that might cause problems
Go
3,160
star
23

secure_headers

Manages application of security headers with many safe defaults
Ruby
3,104
star
24

gov-takedowns

Text of government takedown notices as received. GitHub does not endorse or adopt any assertion contained in the following notices.
3,088
star
25

archive-program

The GitHub Archive Program & Arctic Code Vault
3,000
star
26

scripts-to-rule-them-all

Set of boilerplate scripts describing the normalized script pattern that GitHub uses in its projects.
Shell
2,859
star
27

hotkey

Trigger an action on an element with a keyboard shortcut.
JavaScript
2,851
star
28

relative-time-element

Web component extensions to the standard <time> element.
JavaScript
2,799
star
29

github-elements

GitHub's Web Component collection.
JavaScript
2,523
star
30

renaming

Guidance for changing the default branch name for GitHub repositories
2,408
star
31

view_component

A framework for building reusable, testable & encapsulated view components in Ruby on Rails.
Ruby
2,370
star
32

VisualStudio

GitHub Extension for Visual Studio
C#
2,365
star
33

glb-director

GitHub Load Balancer Director and supporting tooling.
C
2,255
star
34

SoftU2F

Software U2F authenticator for macOS
Swift
2,201
star
35

accessibilityjs

Client side accessibility error scanner.
JavaScript
2,180
star
36

CodeSearchNet

Datasets, tools, and benchmarks for representation learning of code.
Jupyter Notebook
2,155
star
37

balanced-employee-ip-agreement

GitHub's employee intellectual property agreement, open sourced and reusable
2,126
star
38

github-services

Legacy GitHub Services Integration
Ruby
1,902
star
39

platform-samples

A public place for all platform sample projects.
Shell
1,885
star
40

hubot-sans

Hubot Sans, a variable font from GitHub
Shell
1,832
star
41

pages-gem

A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
Ruby
1,782
star
42

india

GitHub resources and information for the developer community in India
Ruby
1,769
star
43

haikus-for-codespaces

EJS
1,753
star
44

site-policy

Collaborative development on GitHub's site policies, procedures, and guidelines
1,743
star
45

government.github.com

Gather, curate, and feature stories of public servants and civic hackers using GitHub as part of their open government innovations
HTML
1,727
star
46

advisory-database

Security vulnerability database inclusive of CVEs and GitHub originated security advisories from the world of open source software.
1,711
star
47

objective-c-style-guide

**Archived** Style guide & coding conventions for Objective-C projects
1,682
star
48

covid19-dashboard

A site that displays up to date COVID-19 stats, powered by fastpages.
Jupyter Notebook
1,644
star
49

lightcrawler

Crawl a website and run it through Google lighthouse
JavaScript
1,471
star
50

rest-api-description

An OpenAPI description for GitHub's REST API
1,372
star
51

feedback

Public feedback discussions for: GitHub for Mobile, GitHub Discussions, GitHub Codespaces, GitHub Sponsors, GitHub Issues and more!
1,359
star
52

developer.github.com

GitHub Developer site
Ruby
1,314
star
53

backup-utils

GitHub Enterprise Backup Utilities
1,190
star
54

brubeck

A Statsd-compatible metrics aggregator
C
1,185
star
55

dev

Press the . key on any repo
1,184
star
56

catalyst

Catalyst is a set of patterns and techniques for developing components within a complex application.
TypeScript
1,183
star
57

codeql-action

Actions for running CodeQL analysis
TypeScript
1,152
star
58

securitylab

Resources related to GitHub Security Lab
C
1,150
star
59

opensourcefriday

๐Ÿšฒ Contribute to the open source community every Friday
HTML
1,143
star
60

graphql-client

A Ruby library for declaring, composing and executing GraphQL queries
Ruby
1,139
star
61

Rebel

Cocoa framework for improving AppKit
Objective-C
1,127
star
62

gh-actions-importer

GitHub Actions Importer helps you plan and automate the migration of Azure DevOps, Bamboo, Bitbucket, CircleCI, GitLab, Jenkins, and Travis CI pipelines to GitHub Actions.
C#
982
star
63

licensed

A Ruby gem to cache and verify the licenses of dependencies
Ruby
942
star
64

.github

Community health files for the @GitHub organization
869
star
65

swordfish

EXPERIMENTAL password management app. Don't use this.
Ruby
740
star
66

details-dialog-element

A modal dialog that's opened with <details>.
JavaScript
739
star
67

stack-graphs

Rust implementation of stack graphs
Rust
725
star
68

codeql-cli-binaries

Binaries for the CodeQL CLI
725
star
69

github-ds

A collection of Ruby libraries for working with SQL on top of ActiveRecord's connection
Ruby
667
star
70

email_reply_parser

Small library to parse plain text email content
Ruby
658
star
71

vulcanizer

GitHub's ops focused Elasticsearch library
Go
657
star
72

github-ospo

Helping open source program offices get started
641
star
73

webauthn-json

๐Ÿ” A small WebAuthn API wrapper that translates to/from pure JSON using base64url.
TypeScript
638
star
74

gh-copilot

Ask for assistance right in your terminal.
637
star
75

rubocop-github

Code style checking for GitHub's Ruby projects
Ruby
616
star
76

safe-settings

JavaScript
606
star
77

codespaces-jupyter

Explore machine learning and data science with Codespaces
Jupyter Notebook
591
star
78

dat-science

Replaced by https://github.com/github/scientist
Ruby
582
star
79

maven-plugins

Official GitHub Maven Plugins
Java
581
star
80

details-menu-element

A menu opened with <details>.
JavaScript
554
star
81

trilogy

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.
C
543
star
82

freno

freno: cooperative, highly available throttler service
Go
534
star
83

smimesign

An S/MIME signing utility for use with Git
Go
519
star
84

brasil

Recursos e informaรงรตes do GitHub para a comunidade de desenvolvedores no Brasil.
Ruby
515
star
85

gh-valet

Valet helps facilitate the migration of Azure DevOps, CircleCI, GitLab CI, Jenkins, and Travis CI pipelines to GitHub Actions.
C#
511
star
86

include-fragment-element

A client-side includes tag.
JavaScript
508
star
87

covid-19-repo-data

Data archive of identifiable COVID-19 related public projects on GitHub
505
star
88

vscode-github-actions

GitHub Actions extension for VS Code
TypeScript
492
star
89

vscode-codeql-starter

Starter workspace to use with the CodeQL extension for Visual Studio Code.
CodeQL
477
star
90

how-engineering-communicates

A community version of the "common API" for how the GitHub Engineering organization communicates
474
star
91

Archimedes

Geometry functions for Cocoa and Cocoa Touch
Objective-C
466
star
92

codeql-go

The CodeQL extractor and libraries for Go.
465
star
93

open-source-survey

The Open Source Survey
431
star
94

synsanity

netfilter (iptables) target for high performance lockless SYN cookies for SYN flood mitigation
C
424
star
95

entitlements-app

The Ruby Gem that Powers Entitlements - GitHub's Identity and Access Management System
Ruby
409
star
96

MVG

MVG = Minimum Viable Governance
379
star
97

issue-metrics

Gather metrics on issues/prs/discussions such as time to first response, count of issues opened, closed, etc.
Python
378
star
98

roskomnadzor

deprecated archive โ€” moved to https://github.com/github/gov-takedowns/tree/master/Russia
376
star
99

clipboard-copy-element

Copy element text content or input values to the clipboard.
JavaScript
374
star
100

codespaces-react

JavaScript
364
star