From 2420feb91fba0437441ebee381d0513c4d80bccd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Apr 2023 19:53:49 +0300 Subject: no more pointless txt files for version --- classes/config.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'classes') diff --git a/classes/config.php b/classes/config.php index 48bbc2258..8e202274f 100644 --- a/classes/config.php +++ b/classes/config.php @@ -323,12 +323,11 @@ class Config { if (empty($this->version)) { $this->version["status"] = -1; - if (file_exists("$root_dir/version_static_official.txt")) { - list ($version, $timestamp, $commit) = explode(" ", file_get_contents("$root_dir/version_static_official.txt")); + if (getenv("BUILD_TIMESTAMP") && getenv("CI_COMMIT_SHORT_SHA")) { - $this->version["version"] = trim($version); - $this->version["timestamp"] = strtotime(trim($timestamp)); - $this->version["commit"] = trim($commit); + $this->version["version"] = sprintf("%s-%s-%s", getenv("BUILD_TIMESTAMP"), getenv("CI_COMMIT_BRANCH"), getenv("CI_COMMIT_SHORT_SHA")); + $this->version["timestamp"] = strtotime(getenv("CI_COMMIT_TIMESTAMP")); + $this->version["commit"] = getenv("CI_COMMIT_SHA"); $this->version["status"] = 0; } else if (PHP_OS === "Darwin") { -- cgit v1.2.3