Semaphore/db_lib/LocalApp.go
Denis Gukov 9323b6aaf3
Some checks failed
Dev / build-local (push) Has been cancelled
Dev / migrate-boltdb (push) Has been cancelled
Dev / migrate-mysql (push) Has been cancelled
Dev / migrate-mariadb (push) Has been cancelled
Dev / migrate-postgres (push) Has been cancelled
Dev / integrate-boltdb (push) Has been cancelled
Dev / integrate-mysql (push) Has been cancelled
Dev / integrate-mariadb (push) Has been cancelled
Dev / integrate-postgres (push) Has been cancelled
Dev / deploy-server (push) Has been cancelled
Dev / deploy-runner (push) Has been cancelled
feat(be): app init params
2024-12-06 13:53:46 +00:00

43 lines
874 B
Go

package db_lib
import (
"fmt"
"os"
"github.com/semaphoreui/semaphore/pkg/task_logger"
"github.com/semaphoreui/semaphore/util"
)
func getEnvironmentVars() []string {
res := []string{
fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
}
for _, e := range util.Config.ForwardedEnvVars {
v := os.Getenv(e)
if v != "" {
res = append(res, fmt.Sprintf("%s=%s", e, v))
}
}
for k, v := range util.Config.EnvVars {
res = append(res, fmt.Sprintf("%s=%s", k, v))
}
return res
}
type LocalAppRunningArgs struct {
CliArgs []string
EnvironmentVars *[]string
Inputs map[string]string
TaskParams interface{}
Callback func(*os.Process)
}
type LocalApp interface {
SetLogger(logger task_logger.Logger) task_logger.Logger
InstallRequirements(environmentVars *[]string, params interface{}) error
Run(args LocalAppRunningArgs) error
}