mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-24 22:06:43 +01:00
a71a3c5686
Some checks are pending
Dev / build-local (push) Waiting to run
Dev / migrate-boltdb (push) Blocked by required conditions
Dev / migrate-mysql (push) Blocked by required conditions
Dev / migrate-mariadb (push) Blocked by required conditions
Dev / migrate-postgres (push) Blocked by required conditions
Dev / integrate-boltdb (push) Blocked by required conditions
Dev / integrate-mysql (push) Blocked by required conditions
Dev / integrate-mariadb (push) Blocked by required conditions
Dev / integrate-postgres (push) Blocked by required conditions
Dev / deploy-server (push) Blocked by required conditions
Dev / deploy-runner (push) Blocked by required conditions
35 lines
729 B
Go
35 lines
729 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 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
|
|
}
|