Skip to content

Commit d145ec4

Browse files
arschlesAaron Schlesinger
authored andcommitted
fix(build.go): decode profile directly from YAML
also, send the dockerfile boolean as a “True” or “False” string. I believe this is for compatibility with the python controller server
1 parent 26f4200 commit d145ec4

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

pkg/gitreceive/build.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"code.google.com/p/go-uuid/uuid"
1414
"github.com/deis/builder/pkg"
1515
"github.com/deis/builder/pkg/log"
16+
"gopkg.in/yaml.v2"
1617
)
1718

1819
const (
@@ -177,9 +178,9 @@ func build(conf *Config, newRev string) error {
177178
if err != nil {
178179
usingDockerfile = false
179180
}
180-
procFile, err := pkg.YamlToJSON(rawProcFile)
181-
if err != nil {
182-
return fmt.Errorf("procfile %s/Procfile is not valid JSON [%s]", tmpDir, err)
181+
var procType pkg.ProcessType
182+
if err := yaml.Unmarshal(rawProcFile, &procType); err != nil {
183+
return fmt.Errorf("procfile %s/ProcFile is malformed (%s)", tmpDir, err)
183184
}
184185

185186
// if [[ ! -f /var/run/secrets/object/store/access-key-id ]]; then
@@ -454,8 +455,8 @@ func build(conf *Config, newRev string) error {
454455
ReceiveUser: conf.Username,
455456
ReceiveRepo: conf.Repository,
456457
Image: conf.ImageName,
457-
Procfile: procFile,
458-
Dockerfile: usingDockerfile,
458+
Procfile: procType,
459+
Dockerfile: strings.Title(fmt.Sprintf("%t", usingDockerfile)),
459460
}
460461
buildHookResp, err := publishRelease(
461462
conf,

0 commit comments

Comments
 (0)