diff options
Diffstat (limited to 'classes/config.php')
-rw-r--r-- | classes/config.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/classes/config.php b/classes/config.php index 2fec4e0..8f7cbec 100644 --- a/classes/config.php +++ b/classes/config.php @@ -77,8 +77,16 @@ class Config { if (empty($this->version)) { $this->version["status"] = -1; - if (PHP_OS === "Darwin") { - $ttrss_version["version"] = "UNKNOWN (Unsupported, Darwin)"; + if (getenv("CI_COMMIT_SHORT_SHA") && getenv("CI_COMMIT_TIMESTAMP")) { + + $this->version["branch"] = getenv("CI_COMMIT_BRANCH"); + $this->version["timestamp"] = strtotime(getenv("CI_COMMIT_TIMESTAMP")); + $this->version["version"] = sprintf("%s-%s", date("y.m", $this->version["timestamp"]), getenv("CI_COMMIT_SHORT_SHA")); + $this->version["commit"] = getenv("CI_COMMIT_SHORT_SHA"); + $this->version["status"] = 0; + + } else if (PHP_OS === "Darwin") { + $this->version["version"] = "UNKNOWN (Unsupported, Darwin)"; } else if (file_exists("$root_dir/version_static.txt")) { $this->version["version"] = trim(file_get_contents("$root_dir/version_static.txt")) . " (Unsupported)"; } else if (is_dir("$root_dir/.git")) { @@ -108,6 +116,7 @@ class Config { "status" => -1, "version" => "", "commit" => "", + "branch" => "", "timestamp" => 0, ]; |