Skip to content

Commit

Permalink
feat(surf): add surf ci provider
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jan 7, 2017
1 parent 1eac36f commit c23f8a6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
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 c23f8a6

Please sign in to comment.