diff --git a/.env.shell b/.env.shell new file mode 100644 index 000000000..ac6181fc5 --- /dev/null +++ b/.env.shell @@ -0,0 +1 @@ +BUILD_COMMIT="$(git rev-parse HEAD)" \ No newline at end of file diff --git a/deployment/bare_metal/build_frontend.sh b/deployment/bare_metal/build_frontend.sh index fc0feb747..2e7e59381 100755 --- a/deployment/bare_metal/build_frontend.sh +++ b/deployment/bare_metal/build_frontend.sh @@ -2,7 +2,9 @@ # For that to work, node v12.19.0 needs to be installed with nvm for root # or NPM_BIN Path and NVM_DIR must be adjusted -cd /var/www/html/gradido/frontend +cd /var/www/html/gradido +eval "echo \"$(cat .env.shell)\"" > .env +cd frontend NPM_BIN=/root/.nvm/versions/node/v12.19.0/bin/npm diff --git a/frontend/src/views/Layout/ContentFooter.vue b/frontend/src/views/Layout/ContentFooter.vue index 09a2418fd..2584747b1 100755 --- a/frontend/src/views/Layout/ContentFooter.vue +++ b/frontend/src/views/Layout/ContentFooter.vue @@ -15,6 +15,9 @@ App version {{ version }} + + {{ shortHash }} + @@ -59,6 +62,8 @@ export default { return { year: new Date().getFullYear(), version: CONFIG.APP_VERSION, + hash: process.env.VUE_APP_BUILD_COMMIT, + shortHash: process.env.VUE_APP_BUILD_COMMIT.substr(0, 8), } }, } diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 9fffda28c..698aca1de 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -1,6 +1,8 @@ const path = require('path') const dotenv = require('dotenv-webpack') +process.env.VUE_APP_BUILD_COMMIT = process.env.BUILD_COMMIT + // vue.config.js module.exports = { devServer: {