Allow targeting different environments with deply. Add version string on the web App component.

This commit is contained in:
2019-05-19 01:28:02 -05:00
parent 4bc8c00c49
commit 30ced3ecfd
7 changed files with 22 additions and 6 deletions

View File

@ -1,3 +1,3 @@
VUE_APP_PM_API_BASE=https://personal-measure.jdb-labs.com/api
VUE_APP_PM_API_BASE=https://pm.jdb-labs.com/api
VUE_APP_LOG_LEVEL=INFO
VUE_APP_API_LOG_LEVEL=ERROR

View File

@ -1,4 +1,3 @@
API_ADDR='localhost:8080'
API_LOG_LEVEL='WARN'
LOG_LEVEL='TRACE'

View File

@ -4,7 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build --mode production",
"build-dev": "vue-cli-service build --mode development",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit"

View File

@ -13,6 +13,7 @@ const logger = logService.getLogger('/app');
})
export default class App extends Vue {
public version = process.env.PM_VERSION;
private apiLogAppender!: ApiLogAppender;
private consoleLogAppender!: ConsoleLogAppender;

View File

@ -12,7 +12,7 @@ export class SimpleDetails extends Vue {
@Prop() private measure!: Measure<MeasureConfig>;
@Prop() private measurements!: Array<Measurement<MeasurementMeta>>;
private newMeasurement;
// private newMeasurement;
private moment = moment;
private chartOptions = {
noData: { text: 'no data',

View File

@ -1,3 +1,10 @@
const merge = require('deepmerge');
const VERSION = {
'process.env': {
PM_VERSION: JSON.stringify(require('./package.json').version)
}
};
module.exports = {
devServer: {
proxy: {
@ -17,5 +24,11 @@ module.exports = {
analyzerMode: 'static',
openAnalyzer: false
}
},
chainWebpack: config => {
config
.plugin('define')
.tap(args => merge(args, [VERSION]))
}
};