-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuilds.go
More file actions
64 lines (46 loc) · 972 Bytes
/
builds.go
File metadata and controls
64 lines (46 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package cmd
import (
"fmt"
"gopkg.in/yaml.v2"
"github.com/deis/deis/client-go/controller/models/builds"
)
// BuildsList lists an app's builds.
func BuildsList(appID string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
builds, err := builds.List(c, appID)
if err != nil {
return err
}
fmt.Printf("=== %s Builds\n", appID)
for _, build := range builds {
fmt.Println(build.UUID, build.Created)
}
return nil
}
// BuildsCreate creates a build for an app.
func BuildsCreate(appID, image, procfile string) error {
c, appID, err := load(appID)
if err != nil {
return err
}
var procfileMap map[string]string
if procfile != "" {
err = yaml.Unmarshal([]byte(procfile), &procfileMap)
if err != nil {
return err
}
}
fmt.Print("Creating build... ")
quit := progress()
_, err = builds.New(c, appID, image, procfileMap)
quit <- true
<-quit
if err != nil {
return err
}
fmt.Println("done")
return nil
}