From 7a54154d4531fe34e7210ea435446a0f475b8656 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Apr 2023 20:06:52 +0300 Subject: we don't need BUILD_TIMESTAMP either --- .docker/app/Dockerfile | 3 --- 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; -- cgit v1.2.3