Add package to display current version

This commit is contained in:
Nabeel Shahzad 2017-12-15 18:02:35 -06:00
parent 5bedbba2a7
commit 451e9ee8f7
8 changed files with 171 additions and 32 deletions

View File

@ -14,7 +14,7 @@ if [ "$TRAVIS" = "true" ]; then
# delete all superfluous files
echo "cleaning files"
find . -type d -name ".git" | xargs rm -rf
find ./vendor -type d -name ".git" | xargs rm -rf
rm -rf .idea phpvms.iml .travis .dpl
rm -rf .phpstorm.meta.php _ide_helper.php
mv .env.dev.example .env

View File

@ -45,6 +45,7 @@
"jackiedo/timezonelist": "5.x",
"tivie/php-os-detector": "1.1.0",
"santigarcor/laratrust": "5.0.3",
"pragmarx/version": "0.2.1",
"nabeel/vacentral": "dev-master"
},
"require-dev": {

123
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "a34f3d409e7a3e41c650c2c201b3e2e7",
"content-hash": "b571a69e74e128cd9d50dd73cf6c8358",
"packages": [
{
"name": "composer/semver",
@ -3261,6 +3261,127 @@
],
"time": "2017-08-03T14:08:16+00:00"
},
{
"name": "pragmarx/version",
"version": "v0.2.1",
"source": {
"type": "git",
"url": "https://github.com/antonioribeiro/version.git",
"reference": "fd2eec365012f2f6e00a20f39e23e8efb8913ae9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/antonioribeiro/version/zipball/fd2eec365012f2f6e00a20f39e23e8efb8913ae9",
"reference": "fd2eec365012f2f6e00a20f39e23e8efb8913ae9",
"shasum": ""
},
"require": {
"laravel/framework": "^5.5",
"php": "^7.0",
"pragmarx/yaml": "^0.1",
"symfony/process": "^3.3"
},
"require-dev": {
"orchestra/testbench": "^3.5",
"phpunit/phpunit": "^6.4"
},
"type": "library",
"extra": {
"component": "package",
"laravel": {
"providers": [
"PragmaRX\\Version\\Package\\ServiceProvider"
],
"aliases": {
"Version": "PragmaRX\\Version\\Package\\Facade"
}
}
},
"autoload": {
"psr-4": {
"PragmaRX\\Version\\Package\\": "src/package",
"PragmaRX\\Version\\Tests\\": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Antonio Carlos Ribeiro",
"email": "acr@antoniocarlosribeiro.com",
"role": "Creator & Designer"
}
],
"description": "Take control over your Laravel app version",
"keywords": [
"laravel",
"version",
"versioning"
],
"time": "2017-12-02T23:56:29+00:00"
},
{
"name": "pragmarx/yaml",
"version": "v0.1.4",
"source": {
"type": "git",
"url": "https://github.com/antonioribeiro/yaml.git",
"reference": "b510623eb5008cc468e00a31259a3c860dd2b267"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/antonioribeiro/yaml/zipball/b510623eb5008cc468e00a31259a3c860dd2b267",
"reference": "b510623eb5008cc468e00a31259a3c860dd2b267",
"shasum": ""
},
"require": {
"laravel/framework": "^5.5",
"php": "^7.0",
"symfony/yaml": "^3.3"
},
"require-dev": {
"orchestra/testbench": "^3.5",
"phpunit/phpunit": "^6.4"
},
"type": "library",
"extra": {
"component": "package",
"laravel": {
"providers": [
"PragmaRX\\Yaml\\Package\\ServiceProvider"
],
"aliases": {
"Yaml": "PragmaRX\\Yaml\\Package\\Facade"
}
}
},
"autoload": {
"psr-4": {
"PragmaRX\\Yaml\\Package\\": "src/package",
"PragmaRX\\Yaml\\Tests\\": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Antonio Carlos Ribeiro",
"email": "acr@antoniocarlosribeiro.com",
"role": "Creator & Designer"
}
],
"description": "Load your Laravel config files using yaml",
"keywords": [
"config",
"laravel",
"yaml"
],
"time": "2017-12-05T20:32:21+00:00"
},
{
"name": "prettus/l5-repository",
"version": "2.6.28",

35
config/version.yml Normal file
View File

@ -0,0 +1,35 @@
version_source: config # "config", "git-local" or "git-remote"
current:
major: 7
minor: 0
patch: 0
format: "{$major}.{$minor}.{$patch}"
cache:
enabled: true
key: pragmarx-version
time: 525600 #minutes = 1 year
build:
#mode: number # "number", "git-local" or "git-remote"
mode: git-local # "number", "git-local" or "git-remote"
number: 701031
length: 6
increment_by: 1
git:
#git-local: "git rev-parse --verify HEAD"
git-local: "git rev-parse --quiet --verify HEAD 2>/dev/null || echo VERSION"
git-remote: "git ls-remote {$repository}"
branch: "refs/heads/master"
repository: "{{ env('VERSION_GIT_REMOTE_REPOSITORY') }}"
version:
git-local: "git describe"
git-remote: "git ls-remote {$repository} | grep tags/ | grep -v {} | cut -d \/ -f 3 | sort --version-sort | tail -1"
matcher: "/[V|v]*[ersion]*\\s*\\.*(\\d+)\\.(\\d+)\\.(\\d+)\\.*(\\w*)/"
format:
major: "{$major}"
minor: "{$minor}"
patch: "{$patch}"
build: "{$build}"
version: "{$major}.{$minor}.{$patch} (build {$build})"
full: "version {{'format.version'}}"
compact: "v{$major}.{$minor}.{$patch}-{$build}"
## add as many formats as you need !!!!

View File

@ -167,6 +167,8 @@
<root url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit-mock-objects" />
<root url="file://$MODULE_DIR$/vendor/pragmarx/version" />
<root url="file://$MODULE_DIR$/vendor/pragmarx/yaml" />
<root url="file://$MODULE_DIR$/vendor/prettus/l5-repository" />
<root url="file://$MODULE_DIR$/vendor/prettus/laravel-validation" />
<root url="file://$MODULE_DIR$/vendor/psr/container" />
@ -265,6 +267,8 @@
<root url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<root url="file://$MODULE_DIR$/vendor/phpunit/phpunit-mock-objects" />
<root url="file://$MODULE_DIR$/vendor/pragmarx/version" />
<root url="file://$MODULE_DIR$/vendor/pragmarx/yaml" />
<root url="file://$MODULE_DIR$/vendor/prettus/l5-repository" />
<root url="file://$MODULE_DIR$/vendor/prettus/laravel-validation" />
<root url="file://$MODULE_DIR$/vendor/psr/container" />

View File

@ -64,34 +64,6 @@
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
@yield('actions')
{{--<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="ti-panel"></i>
<p>Stats</p>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="ti-bell"></i>
<p class="notification">5</p>
<p>Notifications</p>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="#">Notification 1</a></li>
<li><a href="#">Notification 2</a></li>
<li><a href="#">Notification 3</a></li>
<li><a href="#">Notification 4</a></li>
<li><a href="#">Another notification</a></li>
</ul>
</li>
<li>
<a href="#">
<i class="ti-settings"></i>
<p>Settings</p>
</a>
</li>--}}
</ul>
</div>

View File

@ -73,6 +73,12 @@
</div>
</div>
<div class="row" style="position:absolute; bottom: 5%; width: 100%;">
<div class="col-xs-12 text-center">
<p class="small">@version</p>
</div>
</div>
</div>
@endsection

View File

@ -12,7 +12,7 @@
<div>
@if($pirep->status == config('enums.pirep_status.PENDING'))
<div class="badge badge-warning">Pending</div>
@elseif($pirep->status == config('enums.pirep_status.ACCEPTED'))
@elseif($pirep->status === config('enums.pirep_status.ACCEPTED'))
<div class="badge badge-success">Accepted</div>
@else
<div class="badge badge-danger">Rejected</div>
@ -29,7 +29,7 @@
{!! $pirep->arr_airport->icao !!}&nbsp;
</div>
<div><span class="description">Flight Time&nbsp;</span>
{!! Utils::secondsToTime($pirep->flight_time) !!}
{!! Utils::minutesToTimeString($pirep->flight_time) !!}
</div>
<div><span class="description">Aircraft&nbsp;</span>
{!! $pirep->aircraft->registration !!}