示例#1
0
func (self *Upstart) RenderHelperTemplate(service procfile.Service) string {
	data := make(map[string]interface{})

	data["working_directory"] = service.Options.WorkingDirectory
	data["env"] = exporter.RenderEnvClause(service.Options.Env)
	data["cmd"] = service.Cmd

	return exporter.RenderTemplate("helper", helperTemplate, data)
}
示例#2
0
func (sys *Systemd) RenderAppTemplate(appName string, config exporter.Config, app procfile.App) string {
	data := make(map[string]interface{})

	data["app_name"] = appName
	data["user"] = config.User
	data["group"] = config.Group
	data["wants"] = renderWantsClause(appName, app.Services)

	return exporter.RenderTemplate("app", appTemplate, data)
}
示例#3
0
func (self *Upstart) RenderAppTemplate(appName string, config exporter.Config, app procfile.App) string {
	data := make(map[string]interface{})

	data["app_name"] = appName
	data["user"] = config.User
	data["group"] = config.Group
	data["start_level"] = withDefaultLevel(app.StartLevel)
	data["stop_level"] = withDefaultLevel(app.StopLevel)

	return exporter.RenderTemplate("app", appTemplate, data)
}
示例#4
0
func (sys *Systemd) RenderServiceTemplate(appName string, service procfile.Service) string {
	data := make(map[string]interface{})

	data["app_name"] = appName
	data["cmd_name"] = service.Name
	data["kill_timeout"] = service.Options.KillTimeout
	data["respawn_interval"] = service.Options.Respawn.Interval
	data["respawn_count"] = service.Options.Respawn.Count
	data["user"] = service.Options.User
	data["group"] = service.Options.Group
	data["helper_path"] = service.HelperPath
	data["working_directory"] = service.Options.WorkingDirectory
	data["log_path"] = service.Options.LogPath
	data["env"] = exporter.RenderEnvClause(service.Options.Env)

	return exporter.RenderTemplate("service", serviceTemplate, data)
}
示例#5
0
func (self *Upstart) RenderServiceTemplate(appName string, service procfile.Service) string {
	data := make(map[string]interface{})

	data["app_name"] = appName
	data["cmd_name"] = service.Name
	data["kill_timeout"] = service.Options.KillTimeout
	data["respawn_interval"] = service.Options.Respawn.Interval
	data["respawn_count"] = service.Options.Respawn.Count
	data["user"] = service.Options.User
	data["group"] = service.Options.Group
	data["helper_path"] = service.HelperPath
	data["working_directory"] = service.Options.WorkingDirectory
	data["log_path"] = service.Options.LogPath
	data["start_level"] = withDefaultLevel(service.Options.StartLevel)
	data["stop_level"] = withDefaultLevel(service.Options.StopLevel)

	return exporter.RenderTemplate("service", serviceTemplate, data)
}
示例#6
0
func (sys *Systemd) RenderHelperTemplate(service procfile.Service) string {
	data := make(map[string]interface{})
	data["cmd"] = service.Cmd

	return exporter.RenderTemplate("helper", helperTemplate, data)
}