|
| 1 | +// Package builds provides methods for managing app builds. |
1 | 2 | package builds |
2 | 3 |
|
3 | 4 | import ( |
@@ -27,7 +28,33 @@ func List(c *deis.Client, appID string, results int) ([]api.Build, int, error) { |
27 | 28 | return builds, count, nil |
28 | 29 | } |
29 | 30 |
|
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 | +// } |
31 | 58 | func New(c *deis.Client, appID string, image string, |
32 | 59 | procfile map[string]string) (api.Build, error) { |
33 | 60 |
|
|
0 commit comments