mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 11:36:37 +00:00
internal/build: add buildbot env
This commit is contained in:
parent
1a63a76fcc
commit
3603225f82
1 changed files with 28 additions and 0 deletions
|
|
@ -73,6 +73,7 @@ func Env() Environment {
|
||||||
IsPullRequest: os.Getenv("TRAVIS_PULL_REQUEST") != "false",
|
IsPullRequest: os.Getenv("TRAVIS_PULL_REQUEST") != "false",
|
||||||
IsCronJob: os.Getenv("TRAVIS_EVENT_TYPE") == "cron",
|
IsCronJob: os.Getenv("TRAVIS_EVENT_TYPE") == "cron",
|
||||||
}
|
}
|
||||||
|
|
||||||
case os.Getenv("CI") == "True" && os.Getenv("APPVEYOR") == "True":
|
case os.Getenv("CI") == "True" && os.Getenv("APPVEYOR") == "True":
|
||||||
commit := os.Getenv("APPVEYOR_PULL_REQUEST_HEAD_COMMIT")
|
commit := os.Getenv("APPVEYOR_PULL_REQUEST_HEAD_COMMIT")
|
||||||
if commit == "" {
|
if commit == "" {
|
||||||
|
|
@ -90,6 +91,33 @@ func Env() Environment {
|
||||||
IsPullRequest: os.Getenv("APPVEYOR_PULL_REQUEST_NUMBER") != "",
|
IsPullRequest: os.Getenv("APPVEYOR_PULL_REQUEST_NUMBER") != "",
|
||||||
IsCronJob: os.Getenv("APPVEYOR_SCHEDULED_BUILD") == "True",
|
IsCronJob: os.Getenv("APPVEYOR_SCHEDULED_BUILD") == "True",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case os.Getenv("CI") == "true" && os.Getenv("ETH_BUILDBOT") == "true":
|
||||||
|
// For buildbot, the branch variable is the branch OR tag, and
|
||||||
|
// we can distinguish them by the git data prefix.
|
||||||
|
var branch, tag string
|
||||||
|
branchSpec := os.Getenv("BUILD_BRANCH")
|
||||||
|
switch {
|
||||||
|
case strings.HasPrefix(branchSpec, "refs/heads/"):
|
||||||
|
branch = strings.TrimPrefix(branchSpec, "refs/heads/")
|
||||||
|
case strings.HasPrefix(branchSpec, "refs/tags/"):
|
||||||
|
tag = strings.TrimPrefix(branchSpec, "refs/tags/")
|
||||||
|
}
|
||||||
|
|
||||||
|
commit := os.Getenv("BUILD_COMMIT")
|
||||||
|
return Environment{
|
||||||
|
CI: true,
|
||||||
|
Name: "buildbot",
|
||||||
|
Repo: os.Getenv("BUILD_REPO"),
|
||||||
|
Buildnum: os.Getenv("BUILD_NUMBER"),
|
||||||
|
IsPullRequest: os.Getenv("BUILD_IS_PR") == "true",
|
||||||
|
IsCronJob: os.Getenv("BUILD_IS_CRON") == "true",
|
||||||
|
Commit: commit,
|
||||||
|
Date: getDate(commit),
|
||||||
|
Branch: branch,
|
||||||
|
Tag: tag,
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return LocalEnv()
|
return LocalEnv()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue