Semaphore/db_lib/AppFactory.go
2024-02-05 01:38:15 +05:00

24 lines
494 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,
},
}
default:
panic("unknown app")
}
}