summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-10 20:04:38 +0300
committerAndrew Dolgov <[email protected]>2023-04-10 20:04:38 +0300
commit27bd226f2ba46cda1d081ac6ae1e389a10df409f (patch)
treed6532d748912dbbaed90cea801a60a698855469e
parent15c9dbe270b7d96edb4ef436d2cab07ac8fcc873 (diff)
move branch to version tooltip
-rw-r--r--classes/config.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/config.php b/classes/config.php
index 3858825ae..fa14025db 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -311,7 +311,11 @@ class Config {
static function get_version_html() : string {
$version = self::get_version(false);
- return sprintf("<span title=\"%s\n%s\">%s</span>", date("Y-m-d H:i:s", ($version['timestamp'] ?? 0)), $version['commit'], $version['version']);
+ return sprintf("<span title=\"%s\n%s\n%s\">%s</span>",
+ date("Y-m-d H:i:s", ($version['timestamp'] ?? 0)),
+ $version['commit'],
+ $version['branch'] ?? '',
+ $version['version']);
}
/**
@@ -325,7 +329,8 @@ class Config {
if (getenv("BUILD_TIMESTAMP") && getenv("CI_COMMIT_SHORT_SHA")) {
- $this->version["version"] = sprintf("%s-%s-%s", getenv("BUILD_TIMESTAMP"), getenv("CI_COMMIT_BRANCH"), getenv("CI_COMMIT_SHORT_SHA"));
+ $this->version["version"] = sprintf("%s-%s", getenv("BUILD_TIMESTAMP"), getenv("CI_COMMIT_SHORT_SHA"));
+ $this->version["branch"] = getenv("CI_COMMIT_BRANCH");
$this->version["timestamp"] = strtotime(getenv("CI_COMMIT_TIMESTAMP"));
$this->version["commit"] = getenv("CI_COMMIT_SHORT_SHA");
$this->version["status"] = 0;
@@ -367,6 +372,7 @@ class Config {
$rv = [
"status" => -1,
"version" => "",
+ "branch" => "",
"commit" => "",
"timestamp" => 0,
];