no more pointless txt files for version

This commit is contained in:
Andrew Dolgov
2023-04-10 19:53:49 +03:00
parent 8ccea1712e
commit 2420feb91f
2 changed files with 19 additions and 15 deletions

View File

@@ -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") {