diff options
author | Andrew Dolgov <[email protected]> | 2023-04-10 20:06:52 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-04-10 20:06:52 +0300 |
commit | 7a54154d4531fe34e7210ea435446a0f475b8656 (patch) | |
tree | ea507f334558383be798d4b3bf893e02c4aeadff | |
parent | 27bd226f2ba46cda1d081ac6ae1e389a10df409f (diff) |
we don't need BUILD_TIMESTAMP either
-rw-r--r-- | .docker/app/Dockerfile | 3 | ||||
-rw-r--r-- | classes/config.php | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile index b9fee0dec..8677fe080 100644 --- a/.docker/app/Dockerfile +++ b/.docker/app/Dockerfile @@ -19,9 +19,6 @@ RUN apk add --no-cache dcron php81 php81-fpm php81-phar php81-sockets \ /etc/php81/php-fpm.d/www.conf && \ mkdir -p /var/www ${SCRIPT_ROOT}/config.d -ARG BUILD_TIMESTAMP -ENV BUILD_TIMESTAMP=${BUILD_TIMESTAMP} - ARG CI_COMMIT_BRANCH ENV CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} diff --git a/classes/config.php b/classes/config.php index fa14025db..950cf4db0 100644 --- a/classes/config.php +++ b/classes/config.php @@ -327,11 +327,11 @@ class Config { if (empty($this->version)) { $this->version["status"] = -1; - if (getenv("BUILD_TIMESTAMP") && getenv("CI_COMMIT_SHORT_SHA")) { + if (getenv("CI_COMMIT_SHORT_SHA") && getenv("CI_COMMIT_TIMESTAMP")) { - $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["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; |