2021-12-08 10:04:28 +00:00
|
|
|
package utils
|
|
|
|
|
2022-01-25 16:25:23 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-12-08 10:04:28 +00:00
|
|
|
var (
|
2022-01-11 11:05:07 +00:00
|
|
|
CI_COMMIT_SHORT_SHA string
|
|
|
|
CI_COMMIT_BRANCH string
|
|
|
|
CI_COMMIT_TAG string
|
|
|
|
CI_TAGGED bool
|
|
|
|
CI_BUILD bool
|
2021-12-08 10:04:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func Init_build_vars() {
|
2022-01-11 11:05:07 +00:00
|
|
|
if CI_COMMIT_SHORT_SHA == "" && CI_COMMIT_BRANCH == "" {
|
|
|
|
CI_BUILD = false
|
2021-12-08 10:04:28 +00:00
|
|
|
} else {
|
2022-01-11 11:05:07 +00:00
|
|
|
CI_BUILD = true
|
|
|
|
}
|
|
|
|
if CI_COMMIT_TAG == "" {
|
|
|
|
CI_TAGGED = false
|
|
|
|
} else {
|
|
|
|
CI_TAGGED = true
|
2021-12-08 10:04:28 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-25 16:25:23 +00:00
|
|
|
|
|
|
|
func Print_Starting_Screen() {
|
|
|
|
if CI_BUILD {
|
|
|
|
if CI_TAGGED {
|
|
|
|
fmt.Println("---- Starting goshorly " + CI_COMMIT_TAG + " ----")
|
|
|
|
} else {
|
|
|
|
fmt.Println("---- Starting goshorly " + CI_COMMIT_SHORT_SHA + " ----")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
fmt.Println("---- Starting goshorly " + "unknown version" + " ----")
|
|
|
|
}
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|