Creates a new build job. Source code should be uploaded as a tar.gz archive in the multipart form data.
Parameters
Returns
Create a new build
package main
import (
"bytes"
"context"
"fmt"
"io"
"github.com/kernel/hypeman-go"
"github.com/kernel/hypeman-go/option"
)
func main() {
client := hypeman.NewClient(
option.WithAPIKey("My API Key"),
)
build, err := client.Builds.New(context.TODO(), hypeman.BuildNewParams{
Source: io.Reader(bytes.NewBuffer([]byte("some file contents"))),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", build.ID)
}
{
"id": "build-abc123",
"created_at": "2019-12-27T18:11:19.117Z",
"status": "queued",
"builder_instance_id": "builder_instance_id",
"completed_at": "2019-12-27T18:11:19.117Z",
"duration_ms": 0,
"error": "error",
"image_digest": "image_digest",
"image_ref": "image_ref",
"provenance": {
"base_image_digest": "base_image_digest",
"buildkit_version": "buildkit_version",
"lockfile_hashes": {
"foo": "string"
},
"source_hash": "source_hash",
"timestamp": "2019-12-27T18:11:19.117Z"
},
"queue_position": 0,
"started_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
"id": "build-abc123",
"created_at": "2019-12-27T18:11:19.117Z",
"status": "queued",
"builder_instance_id": "builder_instance_id",
"completed_at": "2019-12-27T18:11:19.117Z",
"duration_ms": 0,
"error": "error",
"image_digest": "image_digest",
"image_ref": "image_ref",
"provenance": {
"base_image_digest": "base_image_digest",
"buildkit_version": "buildkit_version",
"lockfile_hashes": {
"foo": "string"
},
"source_hash": "source_hash",
"timestamp": "2019-12-27T18:11:19.117Z"
},
"queue_position": 0,
"started_at": "2019-12-27T18:11:19.117Z"
}