Skip to content

Commit

Permalink
Merge pull request #89 from kwonoj/feat-surf
Browse files Browse the repository at this point in the history
feat(surf): add surf ci provider
  • Loading branch information
orta committed Jan 8, 2017
2 parents 1eac36f + 1e5e785 commit efd7e7b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### master

// Add your own contribution below
* Adds surf-build ci provider - kwonoj

### 0.8.0

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

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

get name(): string {
return "surf-build"
}

get isCI(): boolean {
return ensureEnvKeysExist(this.env, ["SURF_REPO", "SURF_NWO"])
}

get isPR(): boolean {
return this.isCI
}

get pullRequestID(): string {
const key = "SURF_PR_NUM"
return ensureEnvKeysAreInt(this.env, [key]) ? this.env[key] : ""
}

get repoSlug(): string {
return this.env["SURF_NWO"]
}

get supportedPlatforms(): string[] {
return ["github"]
}
}
3 changes: 2 additions & 1 deletion source/ci_source/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import {Circle} from "./Circle"
import {Semaphore} from "./Semaphore"
import {Jenkins} from "./Jenkins"
import {FakeCI} from "./Fake"
import {Surf} from "./Surf"

const providers: Array<any> = [Travis, Circle, Semaphore, Jenkins, FakeCI]
const providers: Array<any> = [Travis, Circle, Semaphore, Jenkins, FakeCI, Surf]
export {
providers
};

0 comments on commit efd7e7b

Please sign in to comment.