--- a/loaders/codebuild/loader.go Sun Jan 21 00:24:55 2018 -0600
+++ b/loaders/codebuild/loader.go Sun Jan 21 21:44:40 2018 -0600
@@ -19,6 +19,7 @@
"github.com/go-yaml/yaml"
@@ -31,11 +32,62 @@
"bitbucket.org/rw_grim/convey/tasks"
+func (l *Loader) loadOptions(options []string) error { + for _, opt := range options { + parts := strings.SplitN(opt, "=", 2) + return fmt.Errorf("invalid option '%s'", opt) + return fmt.Errorf("no image specified") +// Need more input to figure out how this works. +// func (l *Loader) loadDefaultEnvironment() []string { +// "AWS_DEFAULT_REGION=", +// "AWS_REGION=" + l.region, +// "CODEBUILD_BUILD_ARN=", +// "CODEBUILD_BUILD_ID=", +// "CODEBUILD_BUILD_IMAGE=" + l.image, +// "CODEBUILD_BUILD_SUCCEEDING=1", // hard coded for now 1 for succeeding, 0 for failing +// "CODEBUILD_INITIATOR=convey", +// "CODEBUILD_KMS_KEY_ID=", +// "CODEBUILD_RESOLVED_SOURCE_VERSION=", +// "CODEBUILD_SOURCE_REPO_URL=", +// "CODEBUILD_SOURCE_VERSION=", +// "CODEBUILD_SRC_DIR=", func (l *Loader) Load(path, base string, data []byte, options []string, disableDeprecated bool) (*config.Config, error) {
+ err := l.loadOptions(options) - err := yaml.Unmarshal(data, &cb)
+ err = yaml.Unmarshal(data, &cb) @@ -62,7 +114,7 @@
// TODO put the right image here
- err = l.addPhases(cb, cfg, "alpine:edge", &plan)
+ err = l.addPhases(cb, cfg, l.image, &plan)