--- a/bitbucket/loader.go Tue May 02 21:49:17 2017 -0500
+++ b/bitbucket/loader.go Tue May 02 22:25:33 2017 -0500
@@ -24,7 +24,7 @@
"bitbucket.org/rw_grim/convey/config"
"bitbucket.org/rw_grim/convey/docker"
- "bitbucket.org/rw_grim/convey/options"
+ conveyOptions "bitbucket.org/rw_grim/convey/options" "bitbucket.org/rw_grim/convey/plans"
"bitbucket.org/rw_grim/convey/stages"
"bitbucket.org/rw_grim/convey/tasks"
@@ -123,7 +123,7 @@
-func (l *Loader) ResolvePlanName(plan string, cfg *config.Config, opts *options.Options) string {
+func (l *Loader) ResolvePlanName(plan string, cfg *config.Config, opts *conveyOptions.Options) string { // try to shortcut if we can
--- a/bitbucket/types.go Tue May 02 21:49:17 2017 -0500
+++ b/bitbucket/types.go Tue May 02 22:25:33 2017 -0500
@@ -46,16 +46,25 @@
Services map[string]service `yaml:"services"`
+ Docker bool `yaml:"docker"` + Depth int `yaml:"depth"` type bitbucketPipelines struct {
Image string `yaml:"image"`
- Clone int `yaml:"clone"`
+ Clone clone `yaml:"clone"` Pipelines pipelines `yaml:"pipelines"`
Definitions definition `yaml:"definitions"`
+ Options options `yaml:"options"` func (b *bitbucketPipelines) UnmarshalYAML(unmarshal func(interface{}) error) error {
type rawBitbucketPipelines bitbucketPipelines
- raw := rawBitbucketPipelines{Clone: 50}
+ raw := rawBitbucketPipelines{Clone: clone{}} if err := unmarshal(&raw); err != nil {
@@ -65,3 +74,16 @@
+func (c *clone) UnmarshalYAML(unmarshal func(interface{}) error) error { + raw := rawClone{Depth: 50} + if err := unmarshal(&raw); err != nil { --- a/bitbucket/unmarshal_test.go Tue May 02 21:49:17 2017 -0500
+++ b/bitbucket/unmarshal_test.go Tue May 02 22:25:33 2017 -0500
@@ -125,3 +125,41 @@
Expect(actual).To(Equal(expected))
+func (b *bitbucketSuite) TestUnmarshalWithDocker(t *testing.T) { + yamlData := `pipelines: + - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - docker build -t atlassian/my-app:$BITBUCKET_COMMIT . + - docker push atlassian/my-app:$BITBUCKET_COMMIT + var actual bitbucketPipelines + err := yaml.Unmarshal([]byte(yamlData), &actual) + Expect(err).To(BeNil()) + expected := bitbucketPipelines{ + "docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD", + "docker build -t atlassian/my-app:$BITBUCKET_COMMIT .", + "docker push atlassian/my-app:$BITBUCKET_COMMIT", + Expect(actual).To(Equal(expected))