mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
internal/build: use PR commits hashes for PR builds
This commit is contained in:
parent
cc4d72061f
commit
0bb1e76a1d
1 changed files with 12 additions and 4 deletions
|
|
@ -55,11 +55,15 @@ func (env Environment) String() string {
|
||||||
func Env() Environment {
|
func Env() Environment {
|
||||||
switch {
|
switch {
|
||||||
case os.Getenv("CI") == "true" && os.Getenv("TRAVIS") == "true":
|
case os.Getenv("CI") == "true" && os.Getenv("TRAVIS") == "true":
|
||||||
|
commit := os.Getenv("TRAVIS_PULL_REQUEST_SHA")
|
||||||
|
if commit == "" {
|
||||||
|
os.Getenv("TRAVIS_COMMIT")
|
||||||
|
}
|
||||||
return Environment{
|
return Environment{
|
||||||
Name: "travis",
|
Name: "travis",
|
||||||
Repo: os.Getenv("TRAVIS_REPO_SLUG"),
|
Repo: os.Getenv("TRAVIS_REPO_SLUG"),
|
||||||
Commit: os.Getenv("TRAVIS_COMMIT"),
|
Commit: commit,
|
||||||
Date: getDate(os.Getenv("TRAVIS_COMMIT")),
|
Date: getDate(commit),
|
||||||
Branch: os.Getenv("TRAVIS_BRANCH"),
|
Branch: os.Getenv("TRAVIS_BRANCH"),
|
||||||
Tag: os.Getenv("TRAVIS_TAG"),
|
Tag: os.Getenv("TRAVIS_TAG"),
|
||||||
Buildnum: os.Getenv("TRAVIS_BUILD_NUMBER"),
|
Buildnum: os.Getenv("TRAVIS_BUILD_NUMBER"),
|
||||||
|
|
@ -67,11 +71,15 @@ func Env() Environment {
|
||||||
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")
|
||||||
|
if commit == "" {
|
||||||
|
os.Getenv("APPVEYOR_REPO_COMMIT")
|
||||||
|
}
|
||||||
return Environment{
|
return Environment{
|
||||||
Name: "appveyor",
|
Name: "appveyor",
|
||||||
Repo: os.Getenv("APPVEYOR_REPO_NAME"),
|
Repo: os.Getenv("APPVEYOR_REPO_NAME"),
|
||||||
Commit: os.Getenv("APPVEYOR_REPO_COMMIT"),
|
Commit: commit,
|
||||||
Date: getDate(os.Getenv("APPVEYOR_REPO_COMMIT")),
|
Date: getDate(commit),
|
||||||
Branch: os.Getenv("APPVEYOR_REPO_BRANCH"),
|
Branch: os.Getenv("APPVEYOR_REPO_BRANCH"),
|
||||||
Tag: os.Getenv("APPVEYOR_REPO_TAG_NAME"),
|
Tag: os.Getenv("APPVEYOR_REPO_TAG_NAME"),
|
||||||
Buildnum: os.Getenv("APPVEYOR_BUILD_NUMBER"),
|
Buildnum: os.Getenv("APPVEYOR_BUILD_NUMBER"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue