-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7f8f09
commit e7811f4
Showing
10 changed files
with
1,180 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# Building the front end | ||
cd ui | ||
npm i -g @angular/cli | ||
yarn | ||
ng build --prod --aot | ||
yarn build --prod --aot | ||
cp -R dist/ ../service/src/main/resources | ||
cd .. | ||
echo $PWD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import fs = require('fs'); | ||
import { Observable, combineLatest } from 'rxjs'; | ||
|
||
let exec = require('child_process').exec; | ||
|
||
const revision = new Observable<string>(s => { | ||
exec('git rev-parse --short HEAD', | ||
function (error: Error, stdout: Buffer, stderr: Buffer) { | ||
if (error !== null) { | ||
console.log('git error: ' + error + stderr); | ||
} | ||
s.next(stdout.toString().trim()); | ||
s.complete(); | ||
}); | ||
}); | ||
|
||
const branch = new Observable<string>(s => { | ||
exec('git rev-parse --abbrev-ref HEAD', | ||
function (error: Error, stdout: Buffer, stderr: Buffer) { | ||
if (error !== null) { | ||
console.log('git error: ' + error + stderr); | ||
} | ||
s.next(stdout.toString().trim()); | ||
s.complete(); | ||
}); | ||
}); | ||
|
||
const tag = new Observable<string>(s => { | ||
exec('git describe --abbrev=0 --tags', | ||
function (error: Error, stdout: Buffer, stderr: Buffer) { | ||
if (error !== null) { | ||
console.log('git error: ' + error + stderr); | ||
} | ||
s.next(stdout.toString().trim()); | ||
s.complete(); | ||
}); | ||
}); | ||
|
||
combineLatest(revision, branch, tag) | ||
.subscribe(([revision, branch, tag]) => { | ||
console.log(`version: '${process.env.npm_package_version}', revision: '${revision}', branch: '${branch}', tag: '${tag}'`); | ||
|
||
const content = '// this file is automatically generated by git.version.ts script\n' + | ||
`export const versions = {version: '${process.env.npm_package_version}', revision: '${revision}', branch: '${branch}', tag: '${tag}'};`; | ||
|
||
fs.writeFileSync( | ||
'src/environments/versions.ts', | ||
content, | ||
{ encoding: 'utf8' } | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// this file is automatically generated by git.version.ts script | ||
export const versions = {version: '0.0.0', revision: 'a7f8f09', branch: 'master', tag: 'v0.3.2.6'}; |
Oops, something went wrong.