--- a/ChangeLog Mon Feb 12 22:17:07 2018 -0600
+++ b/ChangeLog Mon Feb 12 22:41:56 2018 -0600
@@ -1,4 +1,4 @@
* Changed tasks names for bitbucket pipeline tasks.
* Abstracted the bitbucket pipeline script parsing to a library function.
* Fixed an issue where the files for clean tasks were not having their
@@ -7,6 +7,8 @@
* Set the workdir parameter for docker/run tasks to ${CONVEY_WORKSPACE} if
the image does not have a workdir set and the user has not specified on in
+ * Add a top level convey.yml option for specifying the minimum required + version of convey to use for the convey.yml. Fixed #168 * Write warning, error, and fatal log messages to stderr. Fixed #156
--- a/REFERENCE.md Mon Feb 12 22:17:07 2018 -0600
+++ b/REFERENCE.md Mon Feb 12 22:41:56 2018 -0600
@@ -80,6 +80,12 @@
The complete reference for convey.yml can be found below.
+The `required_version` field let's you specify a minimum required version of +convey to run your `convey.yml`. If a required_version is not specified, +convey will always attempt to run the `convey.yml`. The options section let's you fine tune a few things about your configuration.
--- a/convey.yml Mon Feb 12 22:17:07 2018 -0600
+++ b/convey.yml Mon Feb 12 22:41:56 2018 -0600
@@ -1,5 +1,6 @@
+required_version: 0.13.2-dev - - CONVEY_VERSION=0.13.2dev
+ - CONVEY_VERSION=0.13.2-dev - GO_PACKAGE=bitbucket.org/rw_grim/convey
# tasks for the default plan
--- a/loaders/convey/convey.go Mon Feb 12 22:17:07 2018 -0600
+++ b/loaders/convey/convey.go Mon Feb 12 22:41:56 2018 -0600
@@ -24,10 +24,12 @@
"github.com/aphistic/gomol"
+ "github.com/blang/semver" "github.com/go-yaml/yaml"
toposort "github.com/philopon/go-toposort"
cConfig "bitbucket.org/rw_grim/convey/config"
+ "bitbucket.org/rw_grim/convey/consts" "bitbucket.org/rw_grim/convey/environment"
"bitbucket.org/rw_grim/convey/logging"
"bitbucket.org/rw_grim/convey/plans"
@@ -42,12 +44,13 @@
- Extends string `yaml:"extends"`
- Tasks map[string]yaml.MapSlice `yaml:"tasks"`
- Plans map[string]plans.Plan `yaml:"plans"`
- MetaPlans map[string]plans.MetaPlan `yaml:"meta-plans"`
- Environment cYaml.StringOrSlice `yaml:"environment"`
- Options options `yaml:"options"`
+ RequiredVersion string `yaml:"required_version"` + Extends string `yaml:"extends"` + Tasks map[string]yaml.MapSlice `yaml:"tasks"` + Plans map[string]plans.Plan `yaml:"plans"` + MetaPlans map[string]plans.MetaPlan `yaml:"meta-plans"` + Environment cYaml.StringOrSlice `yaml:"environment"` + Options options `yaml:"options"` @@ -146,6 +149,28 @@
+ if cfg.RequiredVersion != "" { + reqVer, err := semver.Make(cfg.RequiredVersion) + curVer, err := semver.Make(consts.Version) + if !curVer.GTE(reqVer) { + "convey version %s required, but %s is in use.", baseConfig, err := l.loadBase(cfg, path, options, disableDeprecated)
--- a/main.go Mon Feb 12 22:17:07 2018 -0600
+++ b/main.go Mon Feb 12 22:41:56 2018 -0600
@@ -27,6 +27,7 @@
"github.com/aphistic/gomol"
"bitbucket.org/rw_grim/convey/config"
+ "bitbucket.org/rw_grim/convey/consts" "bitbucket.org/rw_grim/convey/environment"
"bitbucket.org/rw_grim/convey/loaders/bitbucket"
"bitbucket.org/rw_grim/convey/loaders/codebuild"
@@ -37,12 +38,8 @@
"bitbucket.org/rw_grim/convey/state"
- app = kingpin.New("convey", "Convey is a container pipeline runner.").Version(version)
+ app = kingpin.New("convey", "Convey is a container pipeline runner.").Version(consts.Version) color = app.Flag("color", "Enable colorized output").Default("true").Bool()
configLoader = app.Flag("config-loader", "Select the configuration loader").Short('l').Default("convey").Enum("convey", "bitbucket", "codebuild")