mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-25 06:15:56 +01:00
b5a99eba7f
* refactor(runners): extract jobs to separate entity
24 lines
556 B
Go
24 lines
556 B
Go
package tasks
|
|
|
|
import (
|
|
"github.com/ansible-semaphore/semaphore/lib"
|
|
"os"
|
|
)
|
|
|
|
type AnsibleJob interface {
|
|
RunGalaxy(args []string) error
|
|
RunPlaybook(args []string, environmentVars *[]string, cb func(*os.Process)) error
|
|
}
|
|
|
|
type LocalAnsibleJob struct {
|
|
playbook *lib.AnsiblePlaybook
|
|
}
|
|
|
|
func (j *LocalAnsibleJob) RunGalaxy(args []string) error {
|
|
return j.playbook.RunGalaxy(args)
|
|
}
|
|
|
|
func (j *LocalAnsibleJob) RunPlaybook(args []string, environmentVars *[]string, cb func(*os.Process)) error {
|
|
return j.playbook.RunPlaybook(args, environmentVars, cb)
|
|
}
|