From 593bb4a235668bc693b1295ab9058d354c46142e Mon Sep 17 00:00:00 2001 From: Travis Shivers Date: Wed, 22 Jul 2020 15:53:25 -0500 Subject: [PATCH] Attempt to inject git info for docker builds --- hooks/build | 13 +++++++++++++ src/views/joinroom.vue | 1 - vue.config.js | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 hooks/build diff --git a/hooks/build b/hooks/build new file mode 100644 index 00000000..cbedf868 --- /dev/null +++ b/hooks/build @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "SOURCE_COMMIT: $SOURCE_COMMIT" + +if [[ -z "$SOURCE_COMMIT" ]]; then + export SOURCE_COMMIT="${SOURCE_COMMIT:-$(git rev-parse HEAD)}" + echo "Updating SOURCE_COMMIT from git rev-parse HEAD" + echo "SOURCE_COMMIT: $SOURCE_COMMIT" +fi + +echo "DOCKER_TAG: $DOCKER_TAG" + +docker build --build-arg "SOURCE_COMMIT=$SOURCE_COMMIT" -f $DOCKERFILE_PATH -t $IMAGE_NAME . diff --git a/src/views/joinroom.vue b/src/views/joinroom.vue index 693f029d..be2f11ea 100644 --- a/src/views/joinroom.vue +++ b/src/views/joinroom.vue @@ -546,7 +546,6 @@ export default { if (this.GET_ROOM) { await this.joinRoom() - .catch(() => {}); } } catch (e) { this.serverError = `Failed to connect to ${this.selectedServer.url}`; diff --git a/vue.config.js b/vue.config.js index 1810c53d..5b552f1d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -16,7 +16,6 @@ try { // Sometimes on CI stuff they build with .git being present // TODO: find better way to do this process.env.VUE_APP_GIT_DATE = new Date().toISOString(); - console.log('env', process.env); if (process.env.SOURCE_COMMIT) { process.env.VUE_APP_GIT_HASH = process.env.SOURCE_COMMIT.substring(0, 7); @@ -27,6 +26,8 @@ try { } } +console.log('env', process.env); + module.exports = { lintOnSave: process.env.NODE_ENV !== 'production', productionSourceMap: false,