Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jun 28, 2017
2 parents 8ad165f + 09dcbd7 commit a0c9bdd
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 24 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Danger JS :no_entry_sign:

[![npm](https://img.shields.io/npm/v/danger.svg)](https://www.npmjs.com/package/danger)
[![Build Status](https://travis-ci.org/danger/danger-js.svg?branch=master)](https://travis-ci.org/danger/danger-js)
[![Build Status](https://ci.appveyor.com/api/projects/status/ep5hgeox3lbc5c7f?svg=true)](https://ci.appveyor.com/project/orta/danger-js/branch/master)
# Danger JS :no_entry_sign: [![npm](https://img.shields.io/npm/v/danger.svg)](https://www.npmjs.com/package/danger) [![Build Status](https://travis-ci.org/danger/danger-js.svg?branch=master)](https://travis-ci.org/danger/danger-js) [![Build Status](https://ci.appveyor.com/api/projects/status/ep5hgeox3lbc5c7f?svg=true)](https://ci.appveyor.com/project/orta/danger-js/branch/master)

Formalize your Pull Request etiquette.

<p align="center">
<a href="#what-is-danger-js">What is Danger JS?</a> &bull;
<a href="VISION.md">Vision</a> &bull;
<a href="##this-thing-is-broken-i-should-help-improve-it">Helping Out</a> &bull;
<a href="#this-thing-is-broken-i-should-help-improve-it">Helping Out</a> &bull;
<a href="http://danger.systems/js/usage/extending-danger.html">Plugin Development</a>
</p>

Expand All @@ -21,6 +17,8 @@ This provides another logical step in your process, through this Danger can help

You can use Danger to codify your teams norms, leaving humans to think about harder problems.

Danger JS currently works with GitHub and Travis CI, Circle CI, Semaphore, Jenkins, Docker Cloud, surf-build, Codeship, Drone, Buildkite, or buddybuild.

## For example?

You can:
Expand All @@ -38,7 +36,7 @@ Danger provides the glue to let _you_ build out the rules specific to your team'

Alright. So, actually, you may be in the wrong place. From here on in, this README is going to be for people who are interested in working on and improving on Danger JS.

We keep all of the end-user documentation at <http://danger.systems>.
We keep all of the end-user documentation at <http://danger.systems/js>.

Some quick links to get you started:

Expand Down Expand Up @@ -67,6 +65,9 @@ yarn test
yarn lint
```

The fixers for both tslint and prettier will be applied when you commit, and on a push your code will be verified
that it compiles.

### What is the TODO?

Check the issues, I try and keep my short term perspective there. Long term is in the [VISION.md](VISION.md).
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Master

- Adds inline docs for all CI providers - orta

### 0.21.1

- Use HTTP for the GitHub status check target URL - macklinu
Expand Down
14 changes: 14 additions & 0 deletions source/ci_source/providers/BuddyBuild.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"

/**
* ### CI Setup
*
* Buddybuild has an integration for Danger JS already built-in.
*
* ### Token Setup
*
* Login to buddybuild and select your app. Go to your *App Settings* and
* in the *Build Settings* menu on the left, choose *Environment Variables*.
*
* #### GitHub
* Add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV.
*
*/
export class BuddyBuild implements CISource {
constructor(private readonly env: Env) {}

Expand Down
18 changes: 18 additions & 0 deletions source/ci_source/providers/Buildkite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"

/**
* ### CI Setup
*
* With BuildKite you run the server yourself, so you will want to run it as a part of your build process.
* It is common to have build steps, so we would recommend adding this to your scrip:
*
* ``` shell
* echo "--- Running Danger"
* bundle exec danger
* ```
*
* ### Token Setup
*
* #### GitHub
*
* As this is self-hosted, you will need to add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV. The alternative
* is to pass in the token as a prefix to the command `DANGER_GITHUB_API_TOKEN="123" bundle exec danger`.
*/
export class Buildkite implements CISource {
constructor(private readonly env: Env) {}

Expand Down
30 changes: 29 additions & 1 deletion source/ci_source/providers/Codeship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,36 @@ import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, getPullRequestIDForBranch } from "../ci_source_helpers"

/**
* Docs: TODO
* ### CI Setup
*
* To make Danger run, add a new step to the `codeship-steps.yml` file:
*
* ```
* - type: parallel:
* ...
* - name: danger
* service: web
* command: yarn danger
* ```
*
* If you're using Codeship Classic, add `yarn danger` to your 'Test Commands'
*
* ### Token Setup
*
* You'll want to edit your `codeship-services.yml` file to include a reference
* to the Danger authentication token: `DANGER_GITHUB_API_TOKEN`.
*
* ```
* project_name:
* ...
* environment:
* - DANGER_GITHUB_API_TOKEN=[my_token]
* ```
*
* If you're using Codeship Classic, add `DANGER_GITHUB_API_TOKEN` to your
* 'Environment' settings.
*/

export class Codeship implements CISource {
private default = { prID: "0" }
constructor(private readonly env: Env) {}
Expand Down
27 changes: 26 additions & 1 deletion source/ci_source/providers/DockerCloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,33 @@ import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist } from "../ci_source_helpers"

/**
* Docs: TODO
*
* ### CI Setup
*
* You'll want to add danger to your existing `Dockerfile.test` (or whatever you
* have choosen as your `sut` Dockerfile.)
*
* ```sh
* ...
*
* CMD ["yarn", "danger"]
* ```
*
* ### Token Setup
*
* #### GitHub
*
* Your `DANGER_GITHUB_API_TOKEN` will need to be exposed to the `sut` part of your
* `docker-compose.yml`. This looks similar to:
*
* ```
* sut:
* ...
* environment:
* - DANGER_GITHUB_API_TOKEN=[my_token]
* ```
*/

export class DockerCloud implements CISource {
constructor(private readonly env: Env) {}

Expand Down
31 changes: 16 additions & 15 deletions source/ci_source/providers/Jenkins.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"

// https://jenkins.io/

/**
* https://jenkins-ci.org
*
* ### CI Setup
* Ah Jenkins, so many memories. So, if you're using Jenkins, you're hosting your own environment.
* ### CI Setup
* Ah Jenkins, so many memories. So, if you're using Jenkins, you're hosting your own environment.
*
* ### GitHub
* You will want to be using the
* [GitHub pull request builder plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin)
* in order to ensure that you have the build environment set up for PR integration.
* ### GitHub
* You will want to be using the
* [GitHub pull request builder plugin](https://wiki.jenkins.io/display/JENKINS/GitHub+pull+request+builder+plugin)
* in order to ensure that you have the build environment set up for PR integration.
*
* With that set up, you can edit your job to add `yarn danger` at the build action.
* With that set up, you can edit your job to add `yarn danger` at the build action.
*
* ### Pipeline
* ### Pipeline
* If you're using [pipelines](https://jenkins.io/solutions/pipeline/) you should be using the
* [GitHub branch source plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Branch+Source+Plugin) for easy setup and handling of PRs.
* [GitHub branch source plugin](https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin) for easy setup and handling of PRs.
*
* After you've set up the plugin, add a `sh 'yarn danger'` line in your pipeline script and make sure that build PRs is enabled.
* After you've set up the plugin, add a `sh 'yarn danger'` line in your pipeline script and make sure that build PRs is enabled.
*
* ## Token Setup
* ## Token Setup
*
* ### GitHub
* As you own the machine, it's up to you to add the environment variable for the `DANGER_GITHUB_API_TOKEN`.
* ### GitHub
* As you own the machine, it's up to you to add the environment variable for the `DANGER_GITHUB_API_TOKEN`.
*/
export class Jenkins implements CISource {
constructor(private readonly env: Env) {}
Expand Down

0 comments on commit a0c9bdd

Please sign in to comment.