Semaphore/db_lib/LocalApp.go

24 lines
558 B
Go
Raw Normal View History

2024-01-30 16:42:56 +01:00
package db_lib
import (
2024-10-22 08:46:26 +02:00
"fmt"
2024-01-30 16:42:56 +01:00
"os"
"github.com/ansible-semaphore/semaphore/pkg/task_logger"
"github.com/ansible-semaphore/semaphore/util"
2024-01-30 16:42:56 +01:00
)
func getEnvironmentVars() []string {
res := []string{}
2024-10-22 08:46:26 +02:00
for k, v := range util.Config.EnvironmentVars {
res = append(res, fmt.Sprintf("%s=%s", k, v))
}
return res
}
2024-01-30 16:42:56 +01:00
type LocalApp interface {
SetLogger(logger task_logger.Logger) task_logger.Logger
InstallRequirements(environmentVars *[]string) error
Run(args []string, environmentVars *[]string, inputs map[string]string, cb func(*os.Process)) error
2024-01-30 16:42:56 +01:00
}