diff --git a/.travis/deploy_script.sh b/.travis/deploy_script.sh
index c9cff9b5..1ba3e764 100755
--- a/.travis/deploy_script.sh
+++ b/.travis/deploy_script.sh
@@ -7,11 +7,10 @@ fi
cd $TRAVIS_BUILD_DIR
if test "$TRAVIS_TAG"; then
- PKG_NAME=$TRAVIS_TAG
VERSION=$TRAVIS_TAG
# Pass in the tag as the version to write out
- php artisan phpvms:version --write $VERSION
+ php artisan phpvms:version --write --write-full-version "${VERSION}"
else
echo "On branch $TRAVIS_BRANCH"
@@ -25,19 +24,20 @@ else
BASE_VERSION=$(php artisan phpvms:version --base-only)
# This now includes the pre-release version, so "-dev" by default
- PKG_NAME=${BASE_VERSION}
+ VERSION=${BASE_VERSION}
# Don't pass in a version here, just write out the latest hash
- php artisan phpvms:version --write >VERSION
- VERSION=$(cat VERSION)
+ php artisan phpvms:version --write "${VERSION}"
fi
+FILE_NAME="phpvms-${VERSION}"
+TAR_NAME="$FILE_NAME.tar.gz"
+ZIP_NAME="$FILE_NAME.zip"
+
echo "Version: $VERSION"
echo "Package name: $TAR_NAME"
-FILE_NAME="phpvms-$PKG_NAME"
-TAR_NAME="$FILE_NAME.tar.gz"
-ZIP_NAME="$FILE_NAME.zip"
+echo "==========================="
echo "Cleaning files"
diff --git a/app/Console/Commands/Version.php b/app/Console/Commands/Version.php
index e4b4a3b6..28b296c7 100644
--- a/app/Console/Commands/Version.php
+++ b/app/Console/Commands/Version.php
@@ -34,7 +34,7 @@ class Version extends Command
// If a version is being passed in, the update the build, etc data against this
if ($this->argument('version')) {
$version = \SemVer\SemVer\Version::fromString($this->argument('version'));
- if ($this->option('write_full_version')) {
+ if ($this->option('write-full-version')) {
$cfg['current']['major'] = $version->getMajor();
$cfg['current']['minor'] = $version->getMinor();
$cfg['current']['patch'] = $version->getPatch();
@@ -51,7 +51,7 @@ class Version extends Command
}
// Always write out the build ID/build number which is the commit hash
- $build_number = $this->versionSvc->getBuildId($cfg);
+ $build_number = $this->versionSvc->generateBuildId($cfg);
$cfg['current']['commit'] = $build_number;
$cfg['build']['number'] = $build_number;
diff --git a/app/Http/Composers/VersionComposer.php b/app/Http/Composers/VersionComposer.php
new file mode 100644
index 00000000..98ab61a0
--- /dev/null
+++ b/app/Http/Composers/VersionComposer.php
@@ -0,0 +1,22 @@
+versionSvc = $versionSvc;
+ }
+
+ public function compose(View $view)
+ {
+ $view->with('version', $this->versionSvc->getCurrentVersion(false));
+ $view->with('version_full', $this->versionSvc->getCurrentVersion(true));
+ }
+}
diff --git a/app/Providers/ComposerServiceProvider.php b/app/Providers/ComposerServiceProvider.php
new file mode 100644
index 00000000..482c27fd
--- /dev/null
+++ b/app/Providers/ComposerServiceProvider.php
@@ -0,0 +1,16 @@
+getBuildId($cfg);
- $cfg['build']['number'] = $build_number;
- $version = $version.'+'.$build_number;
+ if (!empty($build_number)) {
+ $version = $version.'+'.$build_number;
+ }
}
return $version;
@@ -188,9 +207,12 @@ class VersionService extends Service
}
// Replace "dev" with "alpha", since
-
$latest_version = $this->getLatestVersion();
+ if (empty($latest_version)) {
+ return false;
+ }
+
// Convert to semver
if ($this->isGreaterThan($latest_version, $current_version)) {
$this->kvpRepo->save('new_version_available', true);
diff --git a/config/app.php b/config/app.php
index 42903506..897753bc 100755
--- a/config/app.php
+++ b/config/app.php
@@ -77,6 +77,7 @@ return [
App\Providers\AuthServiceProvider::class,
App\Providers\BindServiceProviders::class,
App\Providers\BroadcastServiceProvider::class,
+ App\Providers\ComposerServiceProvider::class,
App\Providers\CronServiceProvider::class,
App\Providers\DirectiveServiceProvider::class,
App\Providers\EventServiceProvider::class,
diff --git a/config/version.yml b/config/version.yml
index 5a8c70ff..ad220595 100644
--- a/config/version.yml
+++ b/config/version.yml
@@ -29,4 +29,4 @@ format:
build: '{$build}'
version: '{$major}.{$minor}.{$patch} (build {$build})'
full: 'version {{''format.version''}}'
- compact: 'v{$major}.{$minor}.{$patch}+{$build}'
+ compact: '{$major}.{$minor}.{$patch}+{$build}'
diff --git a/resources/views/admin/app.blade.php b/resources/views/admin/app.blade.php
index f3eb6998..3052fd9b 100644
--- a/resources/views/admin/app.blade.php
+++ b/resources/views/admin/app.blade.php
@@ -110,6 +110,8 @@
checkboxClass: 'icheckbox_square-blue',
radioClass: 'icheckbox_square-blue'
});
+
+ $('[data-toggle="popover"]').popover();
};
$(document).ready(function () {
diff --git a/resources/views/admin/sidebar.blade.php b/resources/views/admin/sidebar.blade.php
index e6da680d..a349c3f9 100644
--- a/resources/views/admin/sidebar.blade.php
+++ b/resources/views/admin/sidebar.blade.php
@@ -19,9 +19,15 @@
-
@version
+ + version {{ $version }} +