From 612eb522b71870fe00cd0ebbe53f3083fe4bad52 Mon Sep 17 00:00:00 2001 From: Alan Friedman Date: Mon, 13 May 2019 09:57:04 -0400 Subject: [PATCH] Fix for displaying current commit SHA --- build.sh | 1 + client/package.json | 2 +- client/src/components/About/index.js | 6 ++---- server/build.sh | 8 +------- server/src/config.json | 4 ---- server/src/index.js | 3 --- 6 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 server/src/config.json diff --git a/build.sh b/build.sh index 30f3b79..5e4e866 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,7 @@ echo "building client..." cd client yarn --production=false +REACT_APP_COMMIT_SHA=`git rev-parse --short HEAD` \ REACT_APP_API_HOST=$API_HOST \ REACT_APP_API_PROTOCOL=$API_PROTOCOL \ REACT_APP_API_PORT=$API_PORT \ diff --git a/client/package.json b/client/package.json index 4d73eb2..3a8a09a 100644 --- a/client/package.json +++ b/client/package.json @@ -42,7 +42,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "REACT_APP_COMMIT_SHA=`git rev-parse --short HEAD` react-scripts build", + "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/client/src/components/About/index.js b/client/src/components/About/index.js index 1c2c7eb..0805806 100644 --- a/client/src/components/About/index.js +++ b/client/src/components/About/index.js @@ -32,10 +32,8 @@ class About extends Component { return (

Version

-

Client - Commit SHA: {process.env.REACT_APP_COMMIT_SHA}

-

Server - Commit SHA: {this.props.serverSHA}

+

+ Commit SHA: {process.env.REACT_APP_COMMIT_SHA}


Software

diff --git a/server/build.sh b/server/build.sh index b1749d0..dcd5a8d 100755 --- a/server/build.sh +++ b/server/build.sh @@ -1,9 +1,3 @@ rm -rf build rm -rf dist -npx babel src -d dist/src --copy-files - -sha=`git rev-parse HEAD` - -echo $sha - -perl -pi -e "s/SHA/$sha/g" dist/src/config.json \ No newline at end of file +npx babel src -d dist/src --copy-files \ No newline at end of file diff --git a/server/src/config.json b/server/src/config.json deleted file mode 100644 index e16b3a2..0000000 --- a/server/src/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": "VERSION", - "sha": "SHA" -} \ No newline at end of file diff --git a/server/src/index.js b/server/src/index.js index 64b58a3..0b4e25d 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -6,7 +6,6 @@ import Io from 'socket.io'; import KoaBody from 'koa-body'; import cors from 'kcors'; import Router from 'koa-router'; -import config from './config'; import bluebird from 'bluebird'; import Redis from 'redis'; import socketRedis from 'socket.io-redis'; @@ -51,8 +50,6 @@ router.post('/handshake', koaBody, async (ctx) => { ready: true, isLocked: Boolean(roomExists && roomExists.isLocked), size: ((roomExists && roomExists.users.length) || 0) + 1, - version: config.version, - sha: config.sha, }; });