Exemplo n.º 1
0
// transformTaskDefinition converts the compose yml into task definition
func (p *ecsProject) transformTaskDefinition() error {
	context := p.context

	// convert to task definition
	logrus.Debug("Transforming yaml to task definition...")
	taskDefinitionName := utils.GetTaskDefinitionName(context.ECSParams.ComposeProjectNamePrefix, context.Context.ProjectName)
	taskDefinition, err := utils.ConvertToTaskDefinition(taskDefinitionName, &context.Context, p.ServiceConfigs())
	if err != nil {
		return err
	}
	p.entity.SetTaskDefinition(taskDefinition)
	return nil
}
Exemplo n.º 2
0
// load parses the compose yml and transforms into task definition
func (p *ecsProject) load(context libcompose.Context) error {
	logrus.Debug("Parsing the compose yaml...")
	configs, err := utils.UnmarshalComposeConfig(context)
	if err != nil {
		return err
	}
	p.serviceConfigs = configs

	logrus.Debug("Transforming yaml to task definition...")
	taskDefinition, err := utils.ConvertToTaskDefinition(context, p.serviceConfigs)
	if err != nil {
		return err
	}

	p.entity.SetTaskDefinition(taskDefinition)
	return nil
}