pulumi/pkg/encoding/init.go
joeduffy 5f3af891f7 Support Workspaces
This change adds support for Workspaces, a convenient way of sharing settings
among many Stacks, like default cluster targets, configuration settings, and the
like, which are not meant to be distributed as part of the Stack itself.

The following things are included in this checkin:

* At workspace initialization time, detect and parse the .mu/workspace.yaml
  file.  This is pretty rudimentary right now and contains just the default
  cluster targets.  The results are stored in a new ast.Workspace type.

* Rename "target" to "cluster".  This impacts many things, including ast.Target
  being changed to ast.Cluster, and all related fields, the command line --target
  being changed to --cluster, various internal helper functions, and so on.  This
  helps to reinforce the desired mental model.

* Eliminate the ast.Metadata type.  Instead, the metadata moves directly onto
  the Stack.  This reflects the decision to make Stacks "the thing" that is
  distributed, versioned, and is the granularity of dependency.

* During cluster targeting, add the workspace settings into the probing logic.
  We still search in the same order: CLI > Stack > Workspace.
2016-11-22 10:41:07 -08:00

25 lines
513 B
Go

// Copyright 2016 Marapongo, Inc. All rights reserved.
package encoding
import (
"github.com/marapongo/mu/pkg/util"
)
func init() {
// Ensure a marshaler is available for every possible Mufile extension
Marshalers = make(map[string]Marshaler)
for _, ext := range Exts {
switch ext {
case ".json":
Marshalers[ext] = &jsonMarshaler{}
case ".yml":
fallthrough
case ".yaml":
Marshalers[ext] = &yamlMarshaler{}
default:
util.FailMF("No Marshaler available for MufileExt %v", ext)
}
}
}