//deploy
func (this *MicroBoshController) Deploy() {

	// reload data
	this.LoadData()

	microBOSHTemplate := entity.NewMicroBOSHTemplate(mi)

	//	template := entity.MicroBOSHTemplateTextV2

	//	if iaasVersion == defaultVersion {
	//		template = entity.MicroBOSHTemplateTextV3
	//	}

	//	ok, err := microBOSHTemplate.CreateMicroBOSHYaml(template, microPath)
	ok, err := microBOSHTemplate.CreateMicroBOSHYamlFile(iaasVersion, microPath)
	if !ok {
		this.Data["Message"] = fmt.Sprintf("Error: %s", err)
	} else {
		this.Data["Message"] = fmt.Sprintf("Successful make deployment file: %s", microPath)
	}
}
package entity_test

import (
	"github.com/citycloud/citycloud.cf-deploy-ui/entity"
	. "github.com/onsi/ginkgo"
)

var _ = Describe("Testing with Ginkgo", func() {
	It("microbosh template", func() {

		var test = entity.NewMicroBOSH("deployment-microbosh",
			entity.NewNetWork("vip", "netid"),
			entity.NewResources("16384", "flavor_100", "zone2"),
			entity.NewCloudProperties("auth_url", "username", "apikey", "tenant", "defaultkeyname", "privatekey", "ebsurl", "ebskey", "ebssercetkey"))

		var mt = entity.NewMicroBOSHTemplate(test)
		_, err := mt.CreateMicroBOSHYaml(entity.MicroBOSHTemplateTextV2, "/home/ubuntu/temp/microbosh.yml")

		if err != nil {
			GinkgoT().Error(err)
		}
	})
})