mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-06 15:20:29 +00:00
add new envs
This commit is contained in:
1 parent
93e42d1465
commit
222b5100b6
4 files changed
+19
-13
No files matched your search
+10
-7
@@ -75,9 +75,18 @@ func FromEnviron() (Config, error) {
|
||||
cfg.ForgeInstance = runner.ForgeInstance
|
||||
}
|
||||
|
||||
cfg.Client.Address = fmt.Sprintf(
|
||||
"%s://%s",
|
||||
cfg.Client.Proto,
|
||||
cfg.Client.Host,
|
||||
)
|
||||
|
||||
// runner config
|
||||
if cfg.Runner.Environ == nil {
|
||||
cfg.Runner.Environ = map[string]string{}
|
||||
cfg.Runner.Environ = map[string]string{
|
||||
"GITHUB_API_URL": cfg.Client.Address + "/api/v1",
|
||||
"GITHUB_SERVER_URL": cfg.Client.Address,
|
||||
}
|
||||
}
|
||||
if cfg.Runner.Name == "" {
|
||||
cfg.Runner.Name, _ = os.Hostname()
|
||||
@@ -91,12 +100,6 @@ func FromEnviron() (Config, error) {
|
||||
cfg.Platform.Arch = runtime.GOARCH
|
||||
}
|
||||
|
||||
cfg.Client.Address = fmt.Sprintf(
|
||||
"%s://%s",
|
||||
cfg.Client.Proto,
|
||||
cfg.Client.Host,
|
||||
)
|
||||
|
||||
if file := cfg.Runner.EnvFile; file != "" {
|
||||
envs, err := godotenv.Read(file)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user