diff options
author | dspushkin <[email protected]> | 2024-11-11 17:05:32 +0300 |
---|---|---|
committer | dspushkin <[email protected]> | 2024-11-11 17:19:59 +0300 |
commit | 4ef14055d842221fd48435542585f7d5c2d6a55f (patch) | |
tree | 347dc568c6e0040cc09c7b679e8205f474f26bef | |
parent | 68e277a9f5cbae857aca28140671860be1012d08 (diff) |
. Пробрасывать версию релизного бранча в ya package
Как вариант, по аналогии с custom-version опцией(custom_version полем в sandbox), пробрасывать опцию release-version(или release-message) в vcs_info.
Тут представлен вариант как прокинуть его в сборку пакета.
commit_hash:f3766b0f0780bd280b1a9d799bea22add4ca3880
-rw-r--r-- | build/scripts/c_templates/svn_interface.c | 8 | ||||
-rw-r--r-- | build/scripts/c_templates/svnversion.h | 1 | ||||
-rw-r--r-- | build/scripts/vcs_info.py | 6 | ||||
-rw-r--r-- | library/go/core/buildinfo/buildinfo.go | 2 |
4 files changed, 17 insertions, 0 deletions
diff --git a/build/scripts/c_templates/svn_interface.c b/build/scripts/c_templates/svn_interface.c index 8baf1d197bf..4bc8fa87d6a 100644 --- a/build/scripts/c_templates/svn_interface.c +++ b/build/scripts/c_templates/svn_interface.c @@ -150,6 +150,14 @@ const char* GetCustomVersion() { #endif } +const char* GetReleaseVersion() { +#if defined(RELEASE_VERSION) + return RELEASE_VERSION; +#else + return ""; +#endif +} + int GetProgramBuildTimestamp() { #if defined(BUILD_TIMESTAMP) return BUILD_TIMESTAMP; diff --git a/build/scripts/c_templates/svnversion.h b/build/scripts/c_templates/svnversion.h index 8c90323d092..72ccab93881 100644 --- a/build/scripts/c_templates/svnversion.h +++ b/build/scripts/c_templates/svnversion.h @@ -28,6 +28,7 @@ void PrintSvnVersionAndExit(int argc, char* argv[]) Y_HIDDEN; void PrintSvnVersionAndExitEx(int argc, char* argv[], const char* opts) Y_HIDDEN; void PrintSvnVersionAndExit0() Y_HIDDEN; const char* GetCustomVersion() Y_HIDDEN; // Currently returns <str> specified with --custom-version <str> in ya package +const char* GetReleaseVersion() Y_HIDDEN; // Currently returns <str> specified with --release-version <str> in ya package const char* GetProgramScmData() Y_HIDDEN; // verbose multiline message const char* GetProgramShortVersionData() Y_HIDDEN; const char* GetProgramBuildUser() Y_HIDDEN; diff --git a/build/scripts/vcs_info.py b/build/scripts/vcs_info.py index ce28705f08c..3b9bcba7fcd 100644 --- a/build/scripts/vcs_info.py +++ b/build/scripts/vcs_info.py @@ -77,6 +77,7 @@ def get_default_json(): "BUILD_HOST": "localhost", "BUILD_USER": "nobody", "CUSTOM_VERSION": "", + "RELEASE_VERSION": "", "PROGRAM_VERSION": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n\\n", "SCM_DATA": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n", "VCS": "arc", @@ -229,6 +230,10 @@ def print_java_mf(info): lines += wrap( 'Custom-Version-String: ', base64.b64encode(info['CUSTOM_VERSION'].encode('utf-8')).decode('utf-8') ) + if 'RELEASE_VERSION' in info: + lines += wrap( + 'Release-Version-String: ', base64.b64encode(info['RELEASE_VERSION'].encode('utf-8')).decode('utf-8') + ) return lines, names @@ -294,6 +299,7 @@ def print_json(json_file, output_file): OPTIONAL_FIELDS_MAP = { 'BUILD_TIMESTAMP': 'Build-Timestamp', 'CUSTOM_VERSION': 'Custom-Version-String', + 'RELEASE_VERSION': 'Release-Version-String', 'DIRTY': 'Working-Copy-State', } diff --git a/library/go/core/buildinfo/buildinfo.go b/library/go/core/buildinfo/buildinfo.go index 88b7d52c9ee..69e1976704e 100644 --- a/library/go/core/buildinfo/buildinfo.go +++ b/library/go/core/buildinfo/buildinfo.go @@ -21,6 +21,7 @@ type BuildInfo struct { // Linux 77.88.18.146-red.dhcp.yndx.net 4.19.10-300.fc29.x86_64 #1 SMP Mon Dec 17 15:34:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux ProgramVersion string CustomVersion string + ReleaseVersion string User string Host string @@ -53,6 +54,7 @@ var Info BuildInfo func InitBuildInfo(buildinfo map[string]string) { Info.ProgramVersion = strings.TrimRight(buildinfo["PROGRAM_VERSION"], " ") Info.CustomVersion = strings.TrimRight(buildinfo["CUSTOM_VERSION"], " ") + Info.ReleaseVersion = strings.TrimRight(buildinfo["RELEASE_VERSION"], " ") Info.User = buildinfo["BUILD_USER"] Info.Host = buildinfo["BUILD_HOST"] Info.Date = buildinfo["BUILD_DATE"] |