From 6d2b2f4a793fe6f9321fa5ed164af1fd3520e01b Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 27 Feb 2019 15:13:49 -0800 Subject: Simplify local Docker image build --- app/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/functions.php') diff --git a/app/functions.php b/app/functions.php index bb739d0f..fc278029 100644 --- a/app/functions.php +++ b/app/functions.php @@ -166,8 +166,6 @@ function array_column_sum(array &$input, $column) */ function build_app_version($ref, $commit_hash) { - $version = 'master'; - if ($ref !== '$Format:%d$') { $tag = preg_replace('/\s*\(.*tag:\sv([^,]+).*\)/i', '\1', $ref); @@ -177,10 +175,12 @@ function build_app_version($ref, $commit_hash) } if ($commit_hash !== '$Format:%H$') { - $version .= '.'.$commit_hash; + return 'master.'.$commit_hash; + } else if (file_exists('/version.txt')) { + return file_get_contents('/version.txt'); } - return $version; + return 'master.unknown_revision'; } /** -- cgit v1.2.3