we don't need BUILD_TIMESTAMP either

This commit is contained in:
Andrew Dolgov 2023-04-10 20:06:52 +03:00
parent 27bd226f2b
commit 7a54154d45
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
2 changed files with 2 additions and 5 deletions

View File

@ -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}

View File

@ -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;