Skip to content

Commit e9d22c1

Browse files
committed
Updating version reporting in core module.
1 parent 1d10fdf commit e9d22c1

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ coverage.html
2121
/*.bat
2222
/filestorage
2323
app/V1Module/presenters/_autogenerated_annotations_temp.php
24+
/app/.version

app/helpers/Config/ApiConfig.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace App\Helpers;
44

5-
use limenet\GitVersion\Directory;
6-
use limenet\GitVersion\Formatters\CustomFormatter;
75
use Nette;
86
use Nette\Utils\Arrays;
97

@@ -56,7 +54,9 @@ public function __construct(array $config)
5654
$this->versionFormat = Arrays::get($config, ["versionFormat"], "{tag}");
5755

5856
// version is constructed from git version tag
59-
$this->version = (new Directory(__DIR__))->get(new CustomFormatter($this->versionFormat)) ?: "UNKNOWN";
57+
$versionFile = __DIR__ . "/../../.version";
58+
$version = file_exists($versionFile) ? trim(@file_get_contents($versionFile)) : null;
59+
$this->version = $version ?: "UNKNOWN";
6060
}
6161

6262
public function getAddress()

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"ext-zip": ">=1.15",
3939
"latte/latte": "^3.1",
4040
"league/commonmark": "^2.8",
41-
"limenet/git-version": "v0.1.6",
4241
"nelmio/alice": "^3.17",
4342
"nette/application": "^3.2",
4443
"nette/bootstrap": "^3.2",

recodex-api.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ License: MIT
1313
Group: Development/Libraries
1414
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
1515
Prefix: %{_prefix}
16-
Vendor: Petr Stefan <UNKNOWN>
16+
Vendor: ReCodEx Team
1717
Url: https://github.com/ReCodEx/api
1818
Requires(post): systemd
1919
Requires(preun): systemd
@@ -41,6 +41,7 @@ ln -sf /var/log/recodex/core-api %{buildroot}%{install_dir}/log
4141
mkdir -p %{buildroot}%{install_dir}/temp
4242
cp -r www %{buildroot}%{install_dir}/www
4343
cp -r app %{buildroot}%{install_dir}/app
44+
echo "v%{version}-%{release}" > %{buildroot}%{install_dir}/app/.version
4445
cp -r bin %{buildroot}%{install_dir}/bin
4546
cp -r migrations %{buildroot}%{install_dir}/migrations
4647
mkdir -p %{buildroot}%{install_dir}/fixtures

0 commit comments

Comments
 (0)