Fix for displaying current commit SHA

This commit is contained in:
Alan Friedman 2019-05-13 09:57:04 -04:00
parent 438f465c6a
commit 612eb522b7
6 changed files with 5 additions and 19 deletions

View File

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

View File

@ -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"
},

View File

@ -32,10 +32,8 @@ class About extends Component {
return (
<div>
<h4>Version</h4>
<p><strong>Client</strong>
Commit SHA: <a target="_blank" href={`https://github.com/darkwire/darkwire-client/commit/${process.env.REACT_APP_COMMIT_SHA}`}>{process.env.REACT_APP_COMMIT_SHA}</a></p>
<p><strong>Server</strong>
Commit SHA: <a target="_blank" href={`https://github.com/darkwire/darkwire-server/commit/${this.props.serverSHA}`}>{this.props.serverSHA}</a></p>
<p>
Commit SHA: <a target="_blank" href={`https://github.com/darkwire/darkwire.io/commit/${process.env.REACT_APP_COMMIT_SHA}`}>{process.env.REACT_APP_COMMIT_SHA}</a></p>
<br />
<h4>Software</h4>

View File

@ -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
npx babel src -d dist/src --copy-files

View File

@ -1,4 +0,0 @@
{
"version": "VERSION",
"sha": "SHA"
}

View File

@ -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,
};
});