Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #85 from vrockai/HAWKULAR-53_1
Browse files Browse the repository at this point in the history
HAWKULAR-53: Added the git sha info about Hawkular to the title
  • Loading branch information
mtho11 committed Apr 21, 2015
2 parents 2bb7cec + 9092373 commit 5ba344e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions ui/console/src/main/scripts/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ gulp.task('clean-defs', function () {
del(['defs.d.ts/**']);
});

gulp.task('git-sha', function(cb) {
plugins.git.exec({args : 'log -n 1 --oneline'}, function (err, stdout) {
if (err) throw err;
var versionFile = 'version.js';
var gitSha = stdout.slice(0, -1);
var jsString = 'var HawkularVersion = \'' + gitSha + '\';';
fs.writeFileSync(versionFile, jsString);
cb();
});
});

gulp.task('tsc', ['clean-defs'], function () {
var cwd = process.cwd();
var tsResult = gulp.src(config.ts)
Expand Down Expand Up @@ -123,10 +134,10 @@ gulp.task('template', ['tsc'], function () {
.pipe(gulp.dest('.'));
});

gulp.task('concat', ['template'], function () {
gulp.task('concat', ['template', 'git-sha'], function () {
var gZipSize = size(gZippedSizeOptions);

return gulp.src(['compiled.js', 'templates.js'])
return gulp.src(['compiled.js', 'templates.js', 'version.js'])
.pipe(plugins.concat(config.js))
.pipe(gulp.dest(config.dist))
.pipe(size(normalSizeOptions))
Expand Down
1 change: 1 addition & 0 deletions ui/console/src/main/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"gulp-angular-templatecache": "^1.5.0",
"gulp-concat": "^2.4.2",
"gulp-connect": "^2.2.0",
"gulp-git": "1.1.0",
"gulp-load-plugins": "^0.8.0",
"gulp-notify": "^2.1.0",
"gulp-replace": "0.5.3",
Expand Down
3 changes: 2 additions & 1 deletion ui/console/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
<!-- add any scripts under dist/ here -->
<script src="dist/hawkular-console.js"></script>
<script>
document.getElementById("hawkularLogo").title = HawkularComponentsVersions[0].version;
var title = 'HAWKULAR: ' + HawkularVersion + ',&#013;UI-COMP: ' + HawkularComponentsVersions[0].version;
document.getElementById("hawkularLogo").title = title;
var comment = document.createComment(JSON.stringify(HawkularComponentsVersions));
document.getElementsByTagName('body')[0].appendChild(comment);
</script>
Expand Down

0 comments on commit 5ba344e

Please sign in to comment.