Skip to content

Commit bce05d3

Browse files
authored
Merge pull request #148 from vitodeploy/versioning
show current version
2 parents cca4ab7 + 929dd1d commit bce05d3

File tree

13 files changed

+70
-33
lines changed

13 files changed

+70
-33
lines changed

app/Http/Controllers/GitHookController.php renamed to app/Http/Controllers/API/GitHookController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22

3-
namespace App\Http\Controllers;
3+
namespace App\Http\Controllers\API;
44

55
use App\Actions\Site\Deploy;
66
use App\Exceptions\SourceControlIsNotConnected;
77
use App\Facades\Notifier;
8+
use App\Http\Controllers\Controller;
89
use App\Models\GitHook;
910
use App\Models\ServerLog;
1011
use App\Notifications\SourceControlDisconnected;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\API;
4+
5+
use App\Http\Controllers\Controller;
6+
7+
class HealthController extends Controller
8+
{
9+
public function __invoke()
10+
{
11+
return response()->json([
12+
'success' => true,
13+
'version' => vito_version(),
14+
]);
15+
}
16+
}

app/Support/helpers.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ function htmx(): HtmxResponse
2929
{
3030
return new HtmxResponse();
3131
}
32+
33+
function vito_version(): string
34+
{
35+
return exec('git describe --tags');
36+
}

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ COPY docker/php.ini /etc/php/8.2/cli/conf.d/99-vito.ini
2727
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2828

2929
# app
30-
COPY . /var/www/html
31-
RUN rm -rf /var/www/html/vendor
32-
RUN rm -rf /var/www/html/.env
30+
RUN rm -rf /var/www/html
31+
RUN git clone -b 1.x https://github.com/vitodeploy/vito.git /var/www/html
32+
RUN git checkout $(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
3333
RUN composer install --no-dev --prefer-dist
3434
RUN chown -R www-data:www-data /var/www/html \
3535
&& chmod -R 755 /var/www/html/storage /var/www/html/bootstrap/cache

public/build/assets/app-2c6e7578.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/build/assets/app-e3775b0a.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resources/css/app.css": {
3-
"file": "assets/app-2c6e7578.css",
3+
"file": "assets/app-e3775b0a.css",
44
"isEntry": true,
55
"src": "resources/css/app.css"
66
},

resources/views/layouts/navigation.blade.php

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
<nav
22
class="fixed top-0 z-50 flex h-[64px] w-full items-center border-b border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800"
33
>
4-
<div class="w-full px-3 py-3 lg:px-5 lg:pl-3">
4+
<div class="w-full">
55
<div class="flex items-center justify-between">
66
<div class="flex items-center justify-start">
7-
<button
8-
data-drawer-target="logo-sidebar"
9-
data-drawer-toggle="logo-sidebar"
10-
aria-controls="logo-sidebar"
11-
type="button"
12-
class="inline-flex items-center rounded-md p-2 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600 sm:hidden"
7+
<div
8+
class="flex items-center justify-start border-r border-gray-200 px-3 py-3 dark:border-gray-700 md:w-64"
139
>
14-
<span class="sr-only">Open sidebar</span>
15-
<x-heroicon name="o-bars-3-center-left" class="h-6 w-6" />
16-
</button>
17-
<a href="/" class="ms-2 flex md:me-24">
18-
<div class="flex items-center justify-start text-3xl font-extrabold">
19-
<x-application-logo class="h-9 w-9 rounded-md" />
20-
<span class="ml-1 hidden sm:block">Deploy</span>
21-
</div>
22-
</a>
23-
<div class="h-[64px] w-1 border-r border-gray-200 px-3 dark:border-gray-700 md:px-0"></div>
10+
<button
11+
data-drawer-target="logo-sidebar"
12+
data-drawer-toggle="logo-sidebar"
13+
aria-controls="logo-sidebar"
14+
type="button"
15+
class="inline-flex items-center rounded-md p-2 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600 sm:hidden"
16+
>
17+
<span class="sr-only">Open sidebar</span>
18+
<x-heroicon name="o-bars-3-center-left" class="h-6 w-6" />
19+
</button>
20+
<a href="/" class="ms-2 flex md:me-24">
21+
<div class="relative flex items-center justify-start text-3xl font-extrabold">
22+
<x-application-logo class="h-9 w-9 rounded-md" />
23+
<span class="ml-1 hidden md:block">Deploy</span>
24+
<span
25+
class="absolute bottom-0 left-0 right-0 rounded-b-md bg-gray-700/60 text-center text-xs text-white md:relative md:ml-1 md:block md:bg-inherit md:text-inherit"
26+
>
27+
{{ vito_version() }}
28+
</span>
29+
</div>
30+
</a>
31+
</div>
2432
<div class="ml-5 cursor-pointer" x-data="">
2533
<div
2634
class="flex w-full items-center rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm text-gray-900 focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:focus:ring-gray-600"
@@ -31,7 +39,7 @@ class="flex w-full items-center rounded-md border border-gray-200 bg-gray-100 px
3139
</div>
3240
</div>
3341
</div>
34-
<div class="flex items-center">
42+
<div class="flex items-center px-3 py-3">
3543
<div class="mr-3">
3644
@include("layouts.partials.color-scheme")
3745
</div>

resources/views/layouts/partials/search.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@
137137
x-on:click="close"
138138
class="fixed inset-0 bottom-0 left-0 right-0 top-0 z-[1000] items-center bg-gray-500 opacity-75 dark:bg-gray-900"
139139
></div>
140-
<div class="absolute z-[1000] mt-20 lg:scale-110">
141-
<div class="w-[500px]">
140+
<div class="absolute left-1 right-1 z-[1000] mt-20 md:left-auto md:right-auto lg:scale-110">
141+
<div class="w-full px-10 md:w-[500px]">
142142
<x-text-input
143143
id="search-input"
144144
x-ref="input"

routes/api.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

33
// git hook
4-
use App\Http\Controllers\GitHookController;
4+
use App\Http\Controllers\API\GitHookController;
5+
use App\Http\Controllers\API\HealthController;
56
use Illuminate\Support\Facades\Route;
67

7-
Route::any('git-hooks', GitHookController::class)->name('git-hooks');
8+
Route::get('health', HealthController::class)->name('api.health');
9+
Route::any('git-hooks', GitHookController::class)->name('api.git-hooks');

0 commit comments

Comments
 (0)