Skip to content

A free open source IT asset/license management system

Improved versioning script

snipe1be22cf05191
diff --git a/app/Console/Commands/Versioning.php b/app/Console/Commands/Versioning.php
index de0ac022ab..91f1d93d3e 100644
--- a/app/Console/Commands/Versioning.php
+++ b/app/Console/Commands/Versioning.php
@@ -40,20 +40,19 @@ class Versioning extends Command
*/
public function fire()
{
- // Path to the file containing your version
- // This will be overwritten everything you commit a message
- $versionFile = 'config/version.php';
- // The git's output
- // get the argument passed in the git command
- $hash_version = $this->argument('app_version');
+ $versionFile = 'config/version.php';
+ $hash_version = str_replace("\n",'',shell_exec('git describe --tags'));
- // discard the commit hash
- $version = explode('-', $hash_version);
- $realVersion = $version[0];
+ $version = explode('-', $hash_version);
- // save the version array to a variable
- $array = var_export(array('app_version' => $realVersion,'hash_version' => $hash_version), true);
+ $array = var_export(
+ array(
+ 'app_version' => $version[0],
+ 'build_version' => $version[1],
+ 'hash_version' => $version[2],
+ 'full_hash' => $hash_version),
+ true);
// Construct our file content
@@ -64,7 +63,7 @@ CON;
// And finally write the file and output the current version
\File::put($versionFile, $content);
- $this->line('Setting version: '. \config('version.latest'));
+ $this->line('Setting version: '. config('version.app_version').' build '.config('version.build_version').' ('.config('version.hash_version').')');
}
/**
@@ -75,7 +74,6 @@ CON;
protected function getArguments()
{
return array(
- array('app_version', InputArgument::REQUIRED, 'version number is required.'),
);
}
diff --git a/config/version.php b/config/version.php
index 93fd0611ce..38e96f24cc 100644
--- a/config/version.php
+++ b/config/version.php
@@ -1,5 +1,7 @@
<?php
return array (
'app_version' => 'v3.6.0',
- 'hash_version' => 'v3.6.0-67-g7ccef51',
+ 'build_version' => '68',
+ 'hash_version' => 'ge62f3f9',
+ 'full_hash' => 'v3.6.0-68-ge62f3f9',
);
\ No newline at end of file
diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php
index a621a7bb8f..acb53a8cfe 100644
--- a/resources/views/layouts/default.blade.php
+++ b/resources/views/layouts/default.blade.php
@@ -584,7 +584,7 @@
<footer class="main-footer">
<div class="pull-right hidden-xs">
- <b>Version</b> {{ config('version.hash_version') }}
+ <b>Version</b> {{ config('version.app_version') }} build {{ config('version.build_version') }} ({{ config('version.hash_version') }})
<a target="_blank" class="btn btn-default btn-xs" href="https://snipe-it.readme.io">Documentation</a>
<a target="_blank" class="btn btn-default btn-xs" href="https://snipe-it-manual.readme.io">User's Manual</a>
<a target="_blank" class="btn btn-default btn-xs" href="https://snipeitapp.com/support/">Report a Bug</a>