add commit hash with link to github into frontend

This commit is contained in:
einhornimmond 2021-09-06 16:14:39 +02:00
parent 32205dc798
commit db020da387
4 changed files with 11 additions and 1 deletions

1
.env.shell Normal file
View File

@ -0,0 +1 @@
BUILD_COMMIT="$(git rev-parse HEAD)"

View File

@ -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

View File

@ -15,6 +15,9 @@
<a href="https://github.com/gradido/gradido/releases/latest" target="_blank">
App version {{ version }}
</a>
<a :href="'https://github.com/gradido/gradido/commit/' + hash" target="_blank">
{{ shortHash }}
</a>
</div>
</b-col>
</b-row>
@ -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),
}
},
}

View File

@ -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: {