Go to file
Aaron Sky 9481c26290 Added support for Buildkite's JSON errors, and wrote more tests for pagination 2020-05-08 10:06:46 -04:00
.github/workflows Fix an issue with iOS builds not finding a test run destination 2020-05-05 13:23:16 -04:00
.swiftpm/xcode Basic pagination support 2020-05-05 16:52:20 -04:00
Example Basic pagination support 2020-05-05 16:52:20 -04:00
Sources/Buildkite Added support for Buildkite's JSON errors, and wrote more tests for pagination 2020-05-08 10:06:46 -04:00
Tests Added support for Buildkite's JSON errors, and wrote more tests for pagination 2020-05-08 10:06:46 -04:00
.gitignore Initial commit 2020-05-05 12:44:23 -04:00
LICENSE Added support for Buildkite's JSON errors, and wrote more tests for pagination 2020-05-08 10:06:46 -04:00
Package.swift GitHub Actions? 2020-05-05 13:08:55 -04:00
README.md Updated copy to reference latest version 2020-05-05 14:32:42 -04:00

README.md

Buildkite

Build Status

A Swift library and client for the Buildkite REST API.

Usage

Add the dependency to your Package.swift file:

let package = Package(
    name: "myproject",
    dependencies: [
        .package(url: "https://github.com/aaronsky/buildkite-swift.git", from: "0.0.1"),
        ],
    targets: [
        .target(
            name: "myproject",
            dependencies: ["Buildkite"]),
        ]
)

As an example, here is a way you can use the closure-based interface to list all pipelines:

import Buildkite

let client = Buildkite()
client.token = "..." // Your scoped Buildkite API access token
client.send(Pipeline.Resources.List(organization: "buildkite")) { result in
    do {
        let response = try result.get()
        let pipelines = response.content
        print(pipelines)
    } catch {
        print(error)
    }
}

You can even use Combine, if you'd like!

import Buildkite

let client = Buildkite()
client.token = "..." // Your scoped Buildkite API access token

var cancellables: Set<AnyCancellable> = []
client.sendPublisher(Pipeline.Resources.List(organization: "buildkite"))
    .map(\.content)
    .sink(recieveCompletion: { _ in }) { pipelines in
        print(pipelines)   
    }.store(in: &cancellables)

The entire publicly documented REST API surface is supported by this package.

References

License

Buildkite for Swift is released under the BSD-2 license. See LICENSE for details.