Skip to content

Commit

Permalink
feat: release tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Jan 11, 2024
1 parent 4bfdc1a commit b7c71cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ COPY docker/s6-rc.d /etc/s6-overlay/s6-rc.d

COPY --from=assets --chown=www-data:www-data /build/public/build /var/www/public/build

ARG VERSION
ARG REVISION

RUN echo "$VERSION (${REVISION:0:7})" > /var/www/.version

ENV APP_ENV production
ENV APP_DEBUG false
ENV LOG_CHANNEL stderr
Expand Down
11 changes: 11 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Filament\Facades\Filament;
use Filament\Navigation\UserMenuItem;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\File;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -21,6 +22,7 @@ class AppServiceProvider extends ServiceProvider
public function register()
{
$this->registerCarbonMacros();
$this->registerReleaseVersion();

if ($this->app->isLocal()) {
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
Expand Down Expand Up @@ -52,6 +54,15 @@ public function boot()
});
}

public function registerReleaseVersion(): void
{
$version = rescue(fn () => File::get(base_path('.version')), 'develop', report: false);

config([
'sentry.release' => $version,
]);
}

protected function registerCarbonMacros(): void
{
Carbon::macro('toFormattedDate', fn () => $this->translatedFormat(config('forms.components.date_time_picker.display_formats.date')));
Expand Down

0 comments on commit b7c71cc

Please sign in to comment.