Example #1
0
func (g *Godspeed) LoadPlugins() {
	// Load Configuration
	var err error
	var confLoader *plugo.ConfigLoader
	c := &PluginConfig{}
	if g.config.ConfigFile != "" {
		confLoader = &plugo.ConfigLoader{}
		err = confLoader.LoadFromFile(g.config.ConfigFile, &c)
		if err != nil {
			log.Fatalf("Unable to read configuration file: %s", err.Error())
		}
	} else {
		log.Fatal("No config file provided")
	}

	log.SetLevel(log.LogLevel(c.LogLevel))

	// Load all plugins
	g.DeploymentStrategies = make([]DeploymentStrategy, len(c.Deployment))
	plugins := plugo.LoadPluginsWithConfig(confLoader, c.Deployment)
	for i, p := range plugins {
		log.Debug("Loading plugin\t" + log.Colorize(log.YELLOW, c.Deployment[i].Name))
		g.DeploymentStrategies[i] = p.(DeploymentStrategy)
	}
}
Example #2
0
func (s ShellDeploymentStrategy) Teardown() {
	log.Debug("Shell Teardown")
}
Example #3
0
func (s *ECSDeploymentStrategy) Setup() {
	log.Debug("Setting up ECS ")

	s.ecs = ecs.New(nil)
}
Example #4
0
func (s ShellDeploymentStrategy) Setup() {
	log.Debug("Setting up Shell")
}
Example #5
0
func (s *ECSDeploymentStrategy) Teardown() {
	log.Debug("ECS Teardown")
}