Semaphore/db_lib/AppFactory.go
2024-01-30 20:42:56 +05:00

22 lines
406 B
Go

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