Semaphore/db_lib/AppFactory.go
2024-02-05 21:55:09 +01:00

25 lines
518 B
Go

package db_lib
import (
"github.com/ansible-semaphore/semaphore/db"
"github.com/ansible-semaphore/semaphore/lib"
)
func CreateApp(template db.Template, repository db.Repository, logger lib.Logger) LocalApp {
switch template.App {
case db.TemplateAnsible:
return &AnsibleApp{
Template: template,
Repository: repository,
Logger: logger,
Playbook: &AnsiblePlaybook{
TemplateID: template.ID,
Repository: repository,
Logger: logger,
},
}
default:
panic("unknown app")
}
}