Example #1
0
//processComponent iterates through the artifacts in the component and deploy them
func (b *Base) processComponent(c *Component, ask bool) {
	//Iterate through the component and deploy all of its providers
	var prov provider.Provider
	for providerName, artifactEntries := range c.Artifacts {
		artifacts := arrangeArtifacts(artifactEntries)
		b.processArtifacts(c, providerName, ask)

		logrus.Infof("Deploying provider: %s...", providerName)
		prov = provider.New(providerName, b.Target())
		prov.SetArtifacts(artifacts)
		prov.Init()
		prov.Deploy()
	}
}
Example #2
0
//undeployAllProviders will iterate through the components
//and undeploy all of its providers
func (b *Base) undeployAllProviders() {
	defer b.cleanWorkDirectory()
	graph := b.MainfileData.Graph
	var prov provider.Provider
	for _, c := range graph {
		if IsExternal(c) {
			externalDir := b.GetExternallAppDirectory(c)
			externalBase := New(externalDir, "", b.DryRun)
			externalBase.Stop()
			continue
		}
		for providerName, artifactEntries := range c.Artifacts {
			logrus.Infof("Undeploying provider: %s...", providerName)
			prov = provider.New(providerName, b.Target(), b.DryRun)
			artifacts := arrangeArtifacts(artifactEntries)
			prov.SetArtifacts(artifacts)
			prov.Init()
			prov.Undeploy()
		}
	}
}