Skip to content

Commit f03b164

Browse files
docs(builds): add godocs to package (#24)
1 parent 9c803e1 commit f03b164

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

builds/builds.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package builds provides methods for managing app builds.
12
package builds
23

34
import (
@@ -27,7 +28,33 @@ func List(c *deis.Client, appID string, results int) ([]api.Build, int, error) {
2728
return builds, count, nil
2829
}
2930

30-
// New creates a build for an app.
31+
// New creates a build for an app from an docker image.
32+
// By default this will create a cmd process that runs the CMD command from the Dockerfile.
33+
// If you want to define more process types, you can pass a Procfile map,
34+
// where the key is the process name and the value is the command for that process.
35+
// To pull from a private docker registry, a custom username and password must be set in the app's
36+
// configuration object. This can be done with `deis registry:set` or by using this SDK.
37+
//
38+
// This example adds custom registry credentials to an app:
39+
// import (
40+
// "github.com/deis/controller-sdk-go/api"
41+
// "github.com/deis/controller-sdk-go/config"
42+
// )
43+
//
44+
// // Create username/password map
45+
// registryMap := map[string]string{
46+
// "username": "password"
47+
// }
48+
//
49+
// // Create a new configuration, assign the credentials, and set it.
50+
// // Note that config setting is a patching operation, it doesn't overwrite or unset
51+
// // unrelated configuration.
52+
// newConfig := api.Config{}
53+
// newConfig.Registry = registryMap
54+
// _, err := config.Set(<client>, "appname", newConfig)
55+
// if err != nil {
56+
// log.Fatal(err)
57+
// }
3158
func New(c *deis.Client, appID string, image string,
3259
procfile map[string]string) (api.Build, error) {
3360

0 commit comments

Comments
 (0)