2025-11-24 01:19:25 +03:00
|
|
|
package main
|
|
|
|
|
|
2025-11-24 01:32:17 +03:00
|
|
|
import (
|
|
|
|
|
"fmt"
|
2025-11-24 01:46:07 +03:00
|
|
|
"log"
|
2025-11-24 01:32:17 +03:00
|
|
|
"os"
|
|
|
|
|
)
|
2025-11-24 01:19:25 +03:00
|
|
|
|
|
|
|
|
func main() {
|
2025-11-24 01:49:54 +03:00
|
|
|
fmt.Println("Read env from gitea file")
|
|
|
|
|
|
2025-11-24 01:32:17 +03:00
|
|
|
for _, v := range os.Environ() {
|
|
|
|
|
fmt.Println(v)
|
|
|
|
|
}
|
2025-11-24 01:46:07 +03:00
|
|
|
|
|
|
|
|
giteaEnvFile, ok := os.LookupEnv("GITEA_ENV")
|
|
|
|
|
if !ok {
|
|
|
|
|
log.Fatalln("Gitea env file not found")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
raw, err := os.ReadFile(giteaEnvFile)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatalln("Gitea env file read error:", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Println(string(raw))
|
2025-11-24 01:19:25 +03:00
|
|
|
}
|