Skip to content

Commit

Permalink
Creates inline docs for all providers
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jun 27, 2017
1 parent 338bc88 commit 45c727c
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog.md
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
@@ -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
@@ -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
25 changes: 24 additions & 1 deletion source/ci_source/providers/Codeship.ts
Expand Up @@ -2,8 +2,31 @@ import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, getPullRequestIDForBranch } from "../ci_source_helpers"

/**
* Docs: TODO
* ### CI Setup
*
* To make Danger run, add a new steo to the `codeship-steps.yml` file:
*
* ```
* - type: parallel:
* ...
* - name: danger
* service: web
* command: yarn danger
* ```
*
* ### 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]
* ```
*/

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
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
5 changes: 3 additions & 2 deletions source/ci_source/providers/Jenkins.ts
@@ -1,8 +1,9 @@
import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"

// https://jenkins-ci.org

/**
* https://jenkins-ci.org
*
* ### CI Setup
* Ah Jenkins, so many memories. So, if you're using Jenkins, you're hosting your own environment.
*
Expand Down

0 comments on commit 45c727c

Please sign in to comment.