Semaphore/db_lib/AppFactory.go

22 lines
406 B
Go
Raw Normal View History

2024-01-30 16:42:56 +01:00
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")
}
}