mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-21 07:49:34 +01:00
22 lines
406 B
Go
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")
|
||
|
}
|
||
|
}
|