mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-24 22:06:43 +01:00
074e303085
Support OpenTofu and Bash
45 lines
987 B
Go
45 lines
987 B
Go
package db_lib
|
|
|
|
import (
|
|
"github.com/ansible-semaphore/semaphore/db"
|
|
"github.com/ansible-semaphore/semaphore/pkg/task_logger"
|
|
)
|
|
|
|
func CreateApp(template db.Template, repository db.Repository, logger task_logger.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,
|
|
},
|
|
}
|
|
case db.TemplateTerraform:
|
|
return &TerraformApp{
|
|
Template: template,
|
|
Repository: repository,
|
|
Logger: logger,
|
|
Name: TerraformAppTerraform,
|
|
}
|
|
case db.TemplateTofu:
|
|
return &TerraformApp{
|
|
Template: template,
|
|
Repository: repository,
|
|
Logger: logger,
|
|
Name: TerraformAppTofu,
|
|
}
|
|
case db.TemplateBash:
|
|
return &BashApp{
|
|
Template: template,
|
|
Repository: repository,
|
|
Logger: logger,
|
|
}
|
|
default:
|
|
panic("unknown app")
|
|
}
|
|
}
|