Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ coverage.html
/*.bat
/filestorage
app/V1Module/presenters/_autogenerated_annotations_temp.php
/app/.version
6 changes: 3 additions & 3 deletions app/helpers/Config/ApiConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Helpers;

use limenet\GitVersion\Directory;
use limenet\GitVersion\Formatters\CustomFormatter;
use Nette;
use Nette\Utils\Arrays;

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

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

public function getAddress()
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"ext-zip": ">=1.15",
"latte/latte": "^3.1",
"league/commonmark": "^2.8",
"limenet/git-version": "v0.1.6",
"nelmio/alice": "^3.17",
"nette/application": "^3.2",
"nette/bootstrap": "^3.2",
Expand Down
3 changes: 2 additions & 1 deletion recodex-api.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ License: MIT
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Vendor: Petr Stefan <UNKNOWN>
Vendor: ReCodEx Team
Url: https://github.com/ReCodEx/api
Requires(post): systemd
Requires(preun): systemd
Expand Down Expand Up @@ -41,6 +41,7 @@ ln -sf /var/log/recodex/core-api %{buildroot}%{install_dir}/log
mkdir -p %{buildroot}%{install_dir}/temp
cp -r www %{buildroot}%{install_dir}/www
cp -r app %{buildroot}%{install_dir}/app
echo "v%{version}-%{release}" > %{buildroot}%{install_dir}/app/.version
cp -r bin %{buildroot}%{install_dir}/bin
cp -r migrations %{buildroot}%{install_dir}/migrations
mkdir -p %{buildroot}%{install_dir}/fixtures
Expand Down
Loading