()
| 1055 | } |
| 1056 | |
| 1057 | func buildStamp() int64 { |
| 1058 | // If SOURCE_DATE_EPOCH is set, use that. |
| 1059 | if s, _ := strconv.ParseInt(os.Getenv("SOURCE_DATE_EPOCH"), 10, 64); s > 0 { |
| 1060 | return s |
| 1061 | } |
| 1062 | |
| 1063 | // Try to get the timestamp of the latest commit. |
| 1064 | bs, err := runError("git", "show", "-s", "--format=%ct") |
| 1065 | if err != nil { |
| 1066 | // Fall back to "now". |
| 1067 | return time.Now().Unix() |
| 1068 | } |
| 1069 | |
| 1070 | s, _ := strconv.ParseInt(string(bs), 10, 64) |
| 1071 | return s |
| 1072 | } |
| 1073 | |
| 1074 | func buildUser() string { |
| 1075 | if v := os.Getenv("BUILD_USER"); v != "" { |
no test coverage detected