move metaplans/MetaPlan to the runtime package
--- a/config/config.go Thu Dec 23 08:56:02 2021 -0600
+++ b/config/config.go Thu Dec 23 09:08:12 2021 -0600
@@ -22,7 +22,6 @@
log "github.com/sirupsen/logrus"
- "keep.imfreedom.org/grim/convey/metaplans"
"keep.imfreedom.org/grim/convey/plans"
"keep.imfreedom.org/grim/convey/runtime"
@@ -31,7 +30,7 @@
Tasks map[string]runtime.Task
Plans map[string]plans.Plan
- MetaPlans map[string]metaplans.MetaPlan
+ MetaPlans map[string]runtime.MetaPlan --- a/config/raw.go Thu Dec 23 08:56:02 2021 -0600
+++ b/config/raw.go Thu Dec 23 09:08:12 2021 -0600
@@ -5,7 +5,6 @@
- "keep.imfreedom.org/grim/convey/metaplans"
"keep.imfreedom.org/grim/convey/plans"
"keep.imfreedom.org/grim/convey/runtime"
"keep.imfreedom.org/grim/convey/tasks"
@@ -15,7 +14,7 @@
Tasks map[string]yaml.MapSlice
Plans map[string]plans.Plan
- MetaPlans map[string]metaplans.MetaPlan `yaml:"meta-plans"`
+ MetaPlans map[string]runtime.MetaPlan `yaml:"meta-plans"` func (r *rawConfig) processTasks() (map[string]runtime.Task, error) {
--- a/metaplans/metaplans.go Thu Dec 23 08:56:02 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright 2016-2018 Gary Kramlich <grim@reaperworld.com>
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-// MetaPlan is a representation of a meta plan.
- Plans []string `yaml:"plans"`
-// UnmarshalYAML is a custom yaml unmarshaller for MetaPlan's.
-func (m *MetaPlan) UnmarshalYAML(unmarshal func(interface{}) error) error {
- type rawMetaPlan MetaPlan
- if err := unmarshal(&raw); err != nil {
- if len(raw.Plans) == 0 {
- return fmt.Errorf("no plans specified")
--- a/runner/cmd.go Thu Dec 23 08:56:02 2021 -0600
+++ b/runner/cmd.go Thu Dec 23 09:08:12 2021 -0600
@@ -45,6 +45,7 @@
env := environment.New(c.Environment...)
rt := runtime.New(env, configPath, c.ForceSequential, c.KeepWorkspace, c.Timeout)
+ rt.MetaPlans = cfg.MetaPlans --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/metaplans.go Thu Dec 23 09:08:12 2021 -0600
@@ -0,0 +1,44 @@
+// Copyright 2016-2018 Gary Kramlich <grim@reaperworld.com> +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. +// MetaPlan is a representation of a meta plan. + Plans []string `yaml:"plans"` +// UnmarshalYAML is a custom yaml unmarshaller for MetaPlan's. +func (m *MetaPlan) UnmarshalYAML(unmarshal func(interface{}) error) error { + type rawMetaPlan MetaPlan + if err := unmarshal(&raw); err != nil { + if len(raw.Plans) == 0 { + return fmt.Errorf("no plans specified") --- a/runtime/runtime.go Thu Dec 23 08:56:02 2021 -0600
+++ b/runtime/runtime.go Thu Dec 23 09:08:12 2021 -0600
@@ -37,7 +37,8 @@
+ MetaPlans map[string]MetaPlan @@ -49,7 +50,9 @@
ForceSequential: forceSequential,
KeepWorkspace: keepWorkspace,
- Tasks: map[string]Task{},
+ MetaPlans: map[string]MetaPlan{}, + Tasks: map[string]Task{}, rt.Environment.LoadDefaults(configPath)