From 8789135eeda91f4ad9d7049a7b83c602863f85c4 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 9 May 2020 21:39:46 +0200 Subject: [PATCH] Add logging frontend version to console on startup --- .drone.yml | 2 ++ Dockerfile | 1 + src/main.js | 3 +++ src/version.json | 3 +++ 4 files changed, 9 insertions(+) create mode 100644 src/version.json diff --git a/.drone.yml b/.drone.yml index f56bef358f..c12106be2e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,6 +38,7 @@ steps: commands: - yarn --frozen-lockfile - yarn run lint + - echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > version.json - yarn run build - sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing @@ -112,6 +113,7 @@ steps: commands: - yarn --frozen-lockfile - yarn run lint + - echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > version.json - yarn run build - sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing diff --git a/Dockerfile b/Dockerfile index cd090961b1..a79fbac0cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ COPY . ./ RUN \ # Build the frontend yarn install --frozen-lockfile && \ + echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > version.json && \ yarn run build # Stage 2: copy diff --git a/src/main.js b/src/main.js index 5b13ca54b8..6f02f40350 100644 --- a/src/main.js +++ b/src/main.js @@ -2,6 +2,9 @@ import Vue from 'vue' import App from './App.vue' import router from './router' +import {VERSION} from './version.json' +console.info(`Vikunja frontend version ${VERSION}`) + // Register the modal import Modal from './components/modal/Modal' Vue.component('modal', Modal) diff --git a/src/version.json b/src/version.json new file mode 100644 index 0000000000..4ae76ef11d --- /dev/null +++ b/src/version.json @@ -0,0 +1,3 @@ +{ + "VERSION": "0.12" +} \ No newline at end of file